如何在网格视图中使标题行和2列具有固定的按钮,其中autogeneratecolumn = true [英] How to make the header row and 2 columns having buttons as fixed in the grid view where autogeneratecolumn = true
问题描述
嗨
我有以下具体要求。
我的代码中生成了一个GridView,其中2列将有按钮,剩下的列是自动生成的。
在这个GridView中,我必须冻结标题行和两个有按钮的列。
有可能吗?
因为当我搜索时我得到的标题行不能在GridView中冻结,其中AutoGenerateColumn =true。
请建议。
请在下面找到网格结构:
Hi
I have specific requirement as below.
I have a GridView generated in my code where 2 columns will have buttons and the remaining columns are auto-generated.
In this GridView, I have to freeze the header row and the two columns which has buttons.
Is it possible?
Because when I search I'm getting the header rows can't be frozen in a GridView where AutoGenerateColumn = "true".
Kindly suggest.
Please find the Grid structure below:
<asp:GridView ID="grdInternalCostRateData" runat="server" CellPadding="3" EnableModelValidation="True"
ForeColor="Black" GridLines="Vertical" BackColor="White" BorderColor="#999999"
BorderStyle="Solid" BorderWidth="1px" OnRowEditing="grdInternalCostRateData_RowEditing"
OnRowCancelingEdit="grdInternalCostRateData_CancelEdit" OnRowDeleting="grdInternalCostRateData_RowDeleting"
OnRowUpdating="grdInternalCostRateData_RowUpdate" OnRowUpdated="grdInternalCostRateData_RowUpdated">
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:CommandField ShowEditButton="True" ButtonType="Button" />
<asp:CommandField ShowDeleteButton="True" ButtonType="Button" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
</asp:GridView>
谢谢&问候,
Mathi。
Thanks & Regards,
Mathi.
推荐答案
您可以使用任何客户端脚本(如Javascript,pelase refere下面的链接)来释放gridview标头...
http://www.aspsnippets.com/Articles/Dynamically-freeze-ASP.Net-Gridview-header-using-JavaScript.aspx [ ^ ]
http://www.aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-in-ASP.Net.aspx [ ^ ]
You can freaze you gridview header using any client side script like Javascript, pelase refere below links...
http://www.aspsnippets.com/Articles/Dynamically-freeze-ASP.Net-Gridview-header-using-JavaScript.aspx[^]
http://www.aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-in-ASP.Net.aspx[^]
这篇关于如何在网格视图中使标题行和2列具有固定的按钮,其中autogeneratecolumn = true的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!