C# 将属性设置为“代码隐藏”中Radgrid[telerik]的HeaderRow
我在我的ASPX页面上有这样一个RadgridC# 将属性设置为“代码隐藏”中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
<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”