My grid view has 2 handlers, that should handle cell and row formatting.
grid.RowFormatting += gridViewRaces_RowFormatting;
grid.CellFormatting += gridViewRaces_CellFormatting;
And this is their code:
private void gridViewRaces_RowFormatting(object sender, RowFormattingEventArgs e)
{
e.RowElement.DrawFill = true;
e.RowElement.GradientStyle = GradientStyles.Solid;
e.RowElement.RowInfo.Cells[2].Style.BackColor = Color.Blue;
}
private void gridViewRaces_CellFormatting(object sender, CellFormattingEventArgs e) {
e.CellElement.DrawFill = true;
e.CellElement.GradientStyle = GradientStyles.Solid;
e.CellElement.BackColor = Color.Black;
}
}
But i've 2 problems:
1. Event CellFormatting doesn't fire on filling of Grid
2. RowFormatting is firing on filling of Grid, but color of cell doesn't change.
How to change cell color on GridView refresh/setting datasource?