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.

Different style for child tables

Thread ID:

Created:

Updated:

Platform:

Replies:

97148 Nov 2,2010 06:23 AM Nov 7,2010 11:38 PM Windows Forms 3
loading
Tags: Grouping
Raul Rosenthal
Asked On November 2, 2010 06:23 AM

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 06:33 AM

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 05:09 AM

Hi Jisha.

Perfect, thank you.


Jisha Joy [Syncfusion]
Replied On November 7, 2010 11:38 PM

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.

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.

;