如何在gridview中增加列的宽度 [英] how to increase the width of a column in gridview
本文介绍了如何在gridview中增加列的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的Grideview2中,我想增加数据字段''reg_date''的宽度:
我尝试使用以下代码但没有成功。任何人都可以帮助我。
In my Grideview2 I wanted to increase the width of datafield column ''reg_date'':
I tried using the following code but not working out. Can anyone help me out.
<asp:GridView ID="GridView2" runat="server" HorizontalAlign="Center" AutoGenerateColumns="False"
style="border-color: #808000; top: 298px; left: 515px; position: absolute; height: 75px; width: 457px"
PageSize="3" allowpaging="true" onpageindexchanging="GridView2_PageIndexChanging" onselectedindexchanged="GridView2_SelectedIndexChanged" >
<RowStyle HorizontalAlign="Center" />
<Columns >
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="reg_id" HeaderText="reg_id"
SortExpression="reg_id" />
<asp:BoundField DataField="reg_date" HeaderStyle-Width="120" HeaderText="regd date" SortExpression="reg_date" />
<asp:BoundField DataField="noofitems" HeaderText="noofitems"
SortExpression="noofitems" />
<asp:BoundField DataField="amtdue" HeaderText="amtdue"
SortExpression="amtdue" />
<asp:BoundField DataField="eligibile_days" HeaderText="eligibile_days"
SortExpression="eligibile_days" />
</Columns>
<SelectedRowStyle BackColor="#FF6666" />
<HeaderStyle BackColor="#99CCFF" />
<AlternatingRowStyle BackColor="#99CCFF" HorizontalAlign="Center" />
</asp:GridView>
推荐答案
请参阅以下链接
gridview中列的宽度。 />
在asp.net中设置gridview的列宽
在gridview中设置列宽
Refer to the below links
Width of column in gridview.
set column width of a gridview in asp.net
set column width in gridview
这篇关于如何在gridview中增加列的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文