Home Forums WinForms controls Xceed Grid for WinForms Conditional Backcolor Reply To: Conditional Backcolor

User (Old forums)
Member
Post count: 23064

Yes you could. Try this (untested) code:<code>myGrid.DataRowTemplate.Cells[“myColumn”].ValueChanged += new EventHandler(myColumn_ValueChanged);
private void myColumn_ValueChanged(object sender, EventArgs e){
DataCell cell = sender as DataCell;
DataRow row = cell.ParentRow as DataRow;
if (cell.Value == someValue)
row.BackColor = someColor;
else
row.ResetBackColor();
}</code>

Imported from legacy forums. Posted by Tommy (had 190 views)