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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Conditional formatting summary

Thread ID:





70136 Nov 28,2007 05:53 PM UTC Nov 29,2007 10:30 AM UTC WinForms 2
Tags: GridControl
Lorenzo Grassi
Asked On November 28, 2007 05:53 PM UTC

Hi, in a GCC it's possible to conditional formatting summary caption? I have a summary caption for every column and I want red backcolor when the sum is different from 0


Administrator [Syncfusion]
Replied On November 29, 2007 09:55 AM UTC

There are no property settings that will conditionally format caption summary cells.

But one way you can do this is use the TableControlPrepareViewStyleInfo event.

//subscribe to the event somewhere.
this.gridGroupingControl1.TableControlPrepareViewStyleInfo += new GridTableControlPrepareViewStyleInfoEventHandler(gridGroupingControl1_TableControlPrepareViewStyleInfo);

//the event code
void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
if (style != null && style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionSummaryCell)
double d;
if (double.TryParse(style.Text, out d) && d > 0)
style.BackColor = Color.Red;

Lorenzo Grassi
Replied On November 29, 2007 10:30 AM UTC

perfect, it's exactly what I need.

Thank you


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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