简体   繁体   English

Gridview列宽变化

[英]Gridview Column width changing

I have a gridview whose datasource is an oracle database. 我有一个gridview,其数据源是一个oracle数据库。 I want to know how to be able to change column width (in the gridview) when it is being displayed in the web browser. 我想知道如何在Web浏览器中显示列宽时(在gridview中)。

Thank you 谢谢

You can set the column directly with the GridView tag: 您可以使用GridView标签直接设置该列:

<asp:GridView ID="myGrid" runat="server">
  <Columns>
    <asp:BoundField DataField="myColumn" ControlStyle-Width="25%" />
  </Columns>
</asp:GridView>

You could also assign the column a CSS class, and then use CSS to set the column width. 您还可以为列分配CSS类,然后使用CSS设置列宽。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM