change the backcolor of groupcaptioncell in ggc

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

5 Replies

AD Administrator Syncfusion Team February 13, 2007 03:49 PM UTC

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


AD Administrator Syncfusion Team February 13, 2007 04:44 PM UTC

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


AD Administrator Syncfusion Team February 14, 2007 06:06 PM UTC

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


AD Administrator Syncfusion Team February 14, 2007 10:01 PM UTC

Hi Shankar,

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

Best regards,
Haneef


SS Shachar Shimshon February 15, 2007 05:35 AM UTC

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

Loader.
Up arrow icon