Conditional formatting summary

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


2 Replies

AD Administrator Syncfusion Team 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;
}
}
}




LG Lorenzo Grassi November 29, 2007 10:30 AM UTC

perfect, it's exactly what I need.

Thank you
LG



Loader.
Up arrow icon