本文介绍了如何在网格视图中使标题行和2列具有固定的按钮,其中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.

推荐答案


这篇关于如何在网格视图中使标题行和2列具有固定的按钮,其中autogeneratecolumn = true的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 13:31