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

How can I change the color of the Header of the GridGroupingControl after grouping when I click on it.

Thread ID:

Created:

Updated:

Platform:

Replies:

51266 Nov 1,2006 04:49 PM UTC Nov 2,2006 10:54 AM UTC Windows Forms 2
loading
Tags: GridControl
Alexander
Asked On November 1, 2006 04:49 PM UTC

Hello,
How can I change the color of the Header of the GridGroupingControl after grouping by for example column "Suppliers" when I click on this header after grouping.

I have subscribed on such event:
private void clientGridControl_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
//....
//change the color of the header after grouping and when I clicked on this header
}

Best regards, Alexander Semichev.

Administrator [Syncfusion]
Replied On November 2, 2006 04:13 AM UTC

Hi Alexander,

This can be acheived by handling the QueryCellStyleInfo event and set the backcolor of the column header cell if the column presents in the grouped column collection. Please try it and let us know if you need any further assistance

private void grid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if(e.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell )
{
Syncfusion.Grouping.SortColumnDescriptorCollection columns = e.TableCellIdentity.Table.TableDescriptor.GroupedColumns;
if(columns != null && columns.Contains(e.Style.Text))
{
e.Style.Themed = false;
e.Style.BackColor = Color.Blue;
}
}
}

Here is a code snippet.
http://www.syncfusion.com/Support/user/uploads/GroupedColumns_7ee91fde.zip

Best Regards,
Haneef

Alexander
Replied On November 2, 2006 10:54 AM UTC

Hi, thank for the help but it is not that I need... In the attachement there is a my sample where I try to change the color of the caption(Header of the Group) when I click on it after grouping!!!! Is this code is good and correct...

And one more question if we show the rows from the caption that was grouped by(we click on +(plus) of the caption) and when I clik on one of that rows - how I can to change the color of the caption row belongs to.

Send you my attachment with the sample!!!

>Hi Alexander,

This can be acheived by handling the QueryCellStyleInfo event and set the backcolor of the column header cell if the column presents in the grouped column collection. Please try it and let us know if you need any further assistance

private void grid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if(e.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell )
{
Syncfusion.Grouping.SortColumnDescriptorCollection columns = e.TableCellIdentity.Table.TableDescriptor.GroupedColumns;
if(columns != null && columns.Contains(e.Style.Text))
{
e.Style.Themed = false;
e.Style.BackColor = Color.Blue;
}
}
}

Here is a code snippet.
http://www.syncfusion.com/Support/user/uploads/GroupedColumns_7ee91fde.zip

Best Regards,
Haneef


question_GroupedColumns.zip

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

;