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.

Conditional formatting summary

Thread ID:

Created:

Updated:

Platform:

Replies:

70136 Nov 28,2007 12:53 PM Nov 29,2007 05:30 AM Windows Forms 2
loading
Tags: GridControl
Lorenzo Grassi
Asked On November 28, 2007 12:53 PM

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

thank's
LG


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

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 05:30 AM

perfect, it's exactly what I need.

Thank you
LG



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.

;