How to implement coditional formatting in Xceed Grid (i.e. changing row back color based on some cell value)? Solutions that I found involved using AddingDataRow event, but I don’t find this to be best – they require handling reformatting of existing rows on data modification by hand. I’m sure, there is a neat solution for this problem – even DataGridView control has it.
I can do something like it there (in DataGridView) to change cell forecolor:
private void LoginHistoryDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (LoginHistoryDataGridView.Columns[e.ColumnIndex].Name.Equals(“actionDataGridViewTextBoxColumn”))
{
switch ((int)((DataRowView)LoginHistoryDataGridView.Rows[e.RowIndex].DataBoundItem).Row[“ActionId”])
{
case 0:
e.CellStyle.ForeColor = Color.Green;
break;
case 1:
e.CellStyle.ForeColor = Color.Blue;
break;
case 2:
e.CellStyle.ForeColor = Color.Red;
break;
}
}
}
So, I’d like to have something like this in Xceed Grid.
Thanx in advance!
Imported from legacy forums. Posted by Nazar (had 1270 views)