我需要在rowdatabound事件中的syncfusion网格分组控件中为特定网格列添加cssclass。我不知道syntext。请帮帮我。
答案 0 :(得分:0)
Refer the below code example for using the cssClass inside the RowDataBound event. Here you can use apply custom css based on your contidion
//Enable RowDataBound event
this.GridGroupingControl1.RowDataBound += new RowDataBoundEventHandler(GridGroupingControl1_RowDataBound);
void GridGroupingControl1_RowDataBound(object sender, RowDataBoundEventArgs e)
{
if (e.Element.Kind == DisplayElementKind.Record)
{
for (int i = 0; i < e.Row.Cells.Count; i++)
{
if (((Syncfusion.Web.UI.WebControls.Grid.Grouping.GridCell)(e.Row.Cells[i])).ColumnDescriptor.Name == "ShipCity")
{//Apply cssClass inside the RowDataBound event
e.Row.CssClass = "MyClass";
}
}
}
}