Home Forums WinForms controls Xceed Grid for WinForms summary row and formating Reply To: summary row and formating

User (Old forums)
Member
Post count: 23064

1- Simply add a summary row either in the designer or in code, and you can add it to the collection of rows you want, that is, to the fixed header rows of the grid, the footer rows of a group, the footer rows of a detail grid, etc…

e.g.:
<code>
SummaryRow summaryRow1 = new SummaryRow();
gridControl1.FixedHeaderRow.Add( summaryRow1 );
</code>.

2- Use the ValueChanged event on cells, and use the sender to change the format accordingly to the value.

e.g.:
<code>
private void Form1_Load(object sender, System.EventArgs e)
{
foreach( Cell cell in dataRowTemplate1.Cells )
{
cell.ValueChanged += new EventHandler( cell_ValueChanged );
}
}

void cell_ValueChanged( object sender, EventArgs e )
{
DataCell cell = sender as DataCell;
if( cell != null )
{
cell.ForeColor = Color.Red;
cell.BackColor = Color.Blue;
}
}
</code>

Imported from legacy forums. Posted by André (had 339 views)