We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

colors for different grouping level

Hi, Is it possible to use different color for different grouping levels in a grouping grid. I use a caption summary grid, and if i have 3 grouping (summary) levels, each level has the same color. The actual record cells have a different color though. For example if i have a grid with Country , State , city and city population, if i add country and state as grouped cols, and summarize city population, I will get country total and state totals in the same color. I need this to be a bit different. Any help would be great.

1 Reply

AD Administrator Syncfusion Team July 5, 2005 02:13 PM

So you have summaries in the group caption row? If so, you can try using QueryCellStyleInfo to color the different levels. Here is code that colors level 1.
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
	if(e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionSummaryCell)
	{
		GridCaptionRow caption = e.TableCellIdentity.DisplayElement as GridCaptionRow;
		if(caption.ParentGroup.GroupLevel == 1)
			e.Style.BackColor = Color.LightGoldenrodYellow;
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon