GroupCaption Backcolor

Hi together,

I am using the GridConditionalFormatDescriptor to specify some backcolor of my cell according to a special condition. Now I wanna know if this is also possible for GroupingCaption cells.

So for example I have a table which is grouped by a column called ''Type''. Assuming that I have two rows in that table - for the column ''Type'' the values ''Name'' and ''Street''.

So i get two groups ''Name'' and ''Street''. Now I want to color the GroupCaption for ''Name'' red and the GroupCaption for ''Street'' green. Can this be done via the GridConditionalFormatDescriptor?

1 Reply

AD Administrator Syncfusion Team August 8, 2006 01:38 PM UTC

Hi,

You need to handle the QueryCellStyleInfo event to do this. Below is the code snippet.

if (e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
{
Group group = e.TableCellIdentity.DisplayElement.ParentGroup;
if (group.Category != null && group.Name == "Street")
{
e.Style.BackColor = Color.Green;
}
if (group.Category != null && group.Name == "Name")
{
e.Style.BackColor = Color.Red;
}
}

Thanks,
Rajagopal

Loader.
Up arrow icon