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

Different style for child tables

I have a GridGrouping control that displays a three level hierarchy: a master table, a nested (child) table and another table that is child of the second.

I'm trying to color the rows differently for each table.

How can I find out which table I'm asked for in the QueryCellInfo event?

Thanks.
Regards
Raul



3 Replies

JJ Jisha Joy Syncfusion Team November 3, 2010 10:33 AM UTC

Hi Raul,

You could check for the child table names in QueryCellStyleInfo and se the colors accordingly. Please refer to the code:

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if(e.Style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
if (e.Style.TableCellIdentity.DisplayElement.ParentChildTable.Name == "MyChildTable")
{

e.Style.BackColor = Color.LightBlue;
}
else if (e.Style.TableCellIdentity.DisplayElement.ParentChildTable.Name == "MyGrandChildTable")
{
e.Style.BackColor = Color.Lavender;
}
else
e.Style.BackColor = Color.LawnGreen;

}
}

-Jisha



RR Raul Rosenthal November 4, 2010 09:09 AM UTC

Hi Jisha.

Perfect, thank you.



JJ Jisha Joy Syncfusion Team November 8, 2010 04:38 AM UTC

Hi Raul,

Thank you for your update.

Regards,
Jisha


Loader.
Live Chat Icon For mobile
Up arrow icon