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.

change the backcolor of groupcaptioncell in ggc

Thread ID:

Created:

Updated:

Platform:

Replies:

56309 Feb 13,2007 09:59 AM Feb 15,2007 12:35 AM Windows Forms 5
loading
Tags: Tools
Shachar Shimshon
Asked On February 13, 2007 09:59 AM

hi all.
when the user clicks on the groupcaptioncell, can i change the backcolor of this cuurent groupcaption?
how?

Administrator [Syncfusion]
Replied On February 13, 2007 10:49 AM

Hi Shachar,

You can try using the QueryCellStyleInfo event to color current group caption cell. This code will work

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if( e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
{
GridCurrentCellInfo info = e.TableCellIdentity.Table.TableModel.CurrentCellInfo;
if( info != null && info.RowIndex == e.TableCellIdentity.RowIndex )
{
e.Style.Themed = false;
e.Style.BackColor = Color.Red;
}
}
}

Key is to turn off XP Themes for the GroupCaption cells.

Sample : GGCCurrentCaptionColor.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 13, 2007 11:44 AM

hu hannef,
i want my user to trigger the change of the back color.
if i'm handling an event' it's not my trigger.
only when he'll click a button i want to make the change.

>Hi Shachar,

You can try using the QueryCellStyleInfo event to color current group caption cell. This code will work

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if( e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
{
GridCurrentCellInfo info = e.TableCellIdentity.Table.TableModel.CurrentCellInfo;
if( info != null && info.RowIndex == e.TableCellIdentity.RowIndex )
{
e.Style.Themed = false;
e.Style.BackColor = Color.Red;
}
}
}

Key is to turn off XP Themes for the GroupCaption cells.

Sample : GGCCurrentCaptionColor.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 14, 2007 01:06 PM

this example works great.
but - can i know if the user clicks on the groupcaption text and not on the groupcaption-plusminus ?

Administrator [Syncfusion]
Replied On February 14, 2007 05:01 PM

Hi Shankar,

Please try the attached sample and let me know if you are trying something different.
ModifiedGGCCurrentCaptionColor.zip

Best regards,
Haneef

Shachar Shimshon
Replied On February 15, 2007 12:35 AM

this is exactly what i wanted, thanks !!!

>Hi Shankar,

Please try the attached sample and let me know if you are trying something different.
ModifiedGGCCurrentCaptionColor.zip

Best regards,
Haneef

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.

;