Hi Mariusz Juszkiewicz,
Thank you for using Syncfusion control.
You can achieve your requirement to display the different color for different level of grouping by using the sfDataGrid.QueryRowStyle event. Please refer the below code snippet,
this.sfDataGrid.QueryRowStyle += SfDataGrid_QueryRowStyle;
private void SfDataGrid_QueryRowStyle(object sender, QueryRowStyleEventArgs e)
{
if (e.RowType == RowType.CaptionRow || e.RowType == RowType.CaptionCoveredRow)
{
var groupLevel = (e.RowData as Group).Level;
if (groupLevel == 1)
e.Style.BackColor = Color.Red;
else if (groupLevel == 2)
e.Style.BackColor = Color.Bisque;
else if (groupLevel == 3)
e.Style.BackColor = Color.Blue;
else if (groupLevel == 4)
e.Style.BackColor = Color.Yellow;
}
} |
Sample Link:
Please let us know, if you require further assistance on this.
Regards,
Saravanan A.