在面板中设置Gridview标题宽度? [英] Setting Gridview Header Width in Panel?
问题描述
任何人都可以告诉我,
- 我在该面板中有一个Panel(水平滚动)Gridview1已经放置了20列。
-Gridview1根据文本自动调整标题宽度。
- 不使用滚动的WebPage可见的列更改其宽度使用(< asp:TemplateField HeaderText = ItemNoHeaderStyle-Width =90px>)
- 但是当列数增加时,它会根据标题文本调整标题宽度。
< asp:Panel ID =gridViewPnlrunat =serverScrollBars =HorizontalWidth =900px>
< asp:GridView ID =GridView1runat =serverAutoGenerateColumns =falseOnRowDeleting =GridView1_RowDeleting
ShowFooter =trueHeaderStyle-CssClass =GridViewHeaderFooterStyle-BackColor =#4A4E51
OnRowDataBound =GridView1_RowDataBound>
所以,
请回复..
谢谢
Can any one please tell me,
-I have a Panel(horizontal scroll) in that panel Gridview1 has been placed containing 20 columns.
-Gridview1 adjust the header width automatically according to its text.
-Less columns which are visible to a WebPage without using scroll are changing its width using (<asp:TemplateField HeaderText="ItemNo" HeaderStyle-Width="90px">)
-But as the no of columns increases it adjust the header width according to the header text.
<asp:Panel ID="gridViewPnl" runat="server" ScrollBars="Horizontal" Width="900px">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" OnRowDeleting="GridView1_RowDeleting"
ShowFooter="true" HeaderStyle-CssClass="GridViewHeader" FooterStyle-BackColor="#4A4E51"
OnRowDataBound="GridView1_RowDataBound">
So,
Please reply..
Thanks
推荐答案
使用网格视图和面板的液体布局,即以%为单位设置宽度而不是像素解决您的问题。
Use liquid layout of your grid view as well as panel i.e. set width in % not in pixel this will resolve your issue.
这篇关于在面板中设置Gridview标题宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!