I am experiencing a strange behavior in my winforms .net 4 application. I have a form with a tabcontrol having two tabpages, user selects data on tabpage1 and clicks GO butt
Instead of doing:
grdDistProcessing.Rows[0].DefaultCellStyle.BackColor = Color.BurlyWood;
grdDistProcessing.Rows[0].DefaultCellStyle.ForeColor = Color.Black;
Use the CellFormatting event (Display category) for grdDistProcessing, like this:
private void grdDistProcessing_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
e.CellStyle.BackColor = Color.BurlyWood;
e.CellStyle.ForeColor = Color.Black;
}
It should render faster too.