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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Different style for child tables

Thread ID:

Created:

Updated:

Platform:

Replies:

97148 Nov 2,2010 10:23 AM UTC Nov 8,2010 04:38 AM UTC Windows Forms 3
loading
Tags: Grouping
Raul Rosenthal
Asked On November 2, 2010 10:23 AM UTC

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



Jisha Joy [Syncfusion]
Replied On 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


Raul Rosenthal
Replied On November 4, 2010 09:09 AM UTC

Hi Jisha.

Perfect, thank you.


Jisha Joy [Syncfusion]
Replied On November 8, 2010 04:38 AM UTC

Hi Raul,

Thank you for your update.

Regards,
Jisha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;