Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将属性设置为“代码隐藏”中Radgrid[telerik]的HeaderRow_C#_Asp.net_Telerik - Fatal编程技术网

C# 将属性设置为“代码隐藏”中Radgrid[telerik]的HeaderRow

C# 将属性设置为“代码隐藏”中Radgrid[telerik]的HeaderRow,c#,asp.net,telerik,C#,Asp.net,Telerik,我在我的ASPX页面上有这样一个Radgrid <telerik:RadGrid ID="rGVResults"> <MasterTableView AllowPaging="false" CellPadding="0" CellSpacing="0" AllowFilteringByColumn="true" AllowSorting="true" AllowNaturalSort="fal

我在我的ASPX页面上有这样一个Radgrid

   <telerik:RadGrid ID="rGVResults">
          <MasterTableView AllowPaging="false" CellPadding="0" CellSpacing="0"  AllowFilteringByColumn="true" 
                            AllowSorting="true" AllowNaturalSort="false" Width="100%"
                            TableLayout="Auto" Frame="Void" GroupLoadMode="Client">              
          <Columns>
           .
           .
          </Columns>                
          </MasterTableView>
  </telerik:RadGrid>
它适用于asp:gridview,但不适用于telerik radgrid。 我做错了什么

有人能给我推荐一个替代方案吗?

试试这个:

rGVResults.HeaderRow.Cells[0].Attributes.Add("data-class", "expand");
还是这样试试

 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
{  
    if (e.Item is GridDataItem)  
    {  
        GridDataItem dataItem = e.Item as GridDataItem;  
        TableCell cell = dataItem["ColumnUniqueName"];  
        cell.Attributes["data-class"] = "expand";  
    }  
} 
试试这个:

rGVResults.HeaderRow.Cells[0].Attributes.Add("data-class", "expand");
还是这样试试

 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
{  
    if (e.Item is GridDataItem)  
    {  
        GridDataItem dataItem = e.Item as GridDataItem;  
        TableCell cell = dataItem["ColumnUniqueName"];  
        cell.Attributes["data-class"] = "expand";  
    }  
} 
你应该试试这个:

rGVResults.HeaderStyle.CssClass = "expand";
默认值为System.String.Empty。

您应该尝试以下操作:

rGVResults.HeaderStyle.CssClass = "expand";

默认值为System.String.Empty。

尝试了该选项。获取一条错误消息,说明“Telerik.Web.UI.RadGrid”不包含“HeaderRow”的定义,并且找不到接受类型为“Telerik.Web.UI.RadGrid”的第一个参数的扩展方法“HeaderRow”。获取一条错误消息,说明“Telerik.Web.UI.RadGrid”不包含“HeaderRow”的定义,并且找不到接受类型为“Telerik.Web.UI.RadGrid”的第一个参数的扩展方法“HeaderRow”