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.

GroupCaption Backcolor

Thread ID:





47557 Aug 8,2006 07:36 AM Aug 8,2006 09:38 AM Windows Forms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On August 8, 2006 07:36 AM

Hi together,

I am using the GridConditionalFormatDescriptor to specify some backcolor of my cell according to a special condition. Now I wanna know if this is also possible for GroupingCaption cells.

So for example I have a table which is grouped by a column called ''Type''. Assuming that I have two rows in that table - for the column ''Type'' the values ''Name'' and ''Street''.

So i get two groups ''Name'' and ''Street''. Now I want to color the GroupCaption for ''Name'' red and the GroupCaption for ''Street'' green. Can this be done via the GridConditionalFormatDescriptor?

Administrator [Syncfusion]
Replied On August 8, 2006 09:38 AM


You need to handle the QueryCellStyleInfo event to do this. Below is the code snippet.

if (e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
Group group = e.TableCellIdentity.DisplayElement.ParentGroup;
if (group.Category != null && group.Name == "Street")
e.Style.BackColor = Color.Green;
if (group.Category != null && group.Name == "Name")
e.Style.BackColor = Color.Red;



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.