I am importing data from an XML document to populate a DataGridView. During the import, I change the back color of some of the cells. However, as I add the rows, the color of the cells do not updated properly (I get a grey cell). I am not sure if there is a place I should be invalidating the DataGridView to get the cells to show up properly.
I should mention that my DataGridView is not data bound.
Some code for reference:
DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[0].Clone();
for(int j = 0; j < dataGridView1.ColumnCount; ++j)
{
if(j == 2)
{
row.Cells[j + 1].Style.BackColor = layer.Color;
}
}
this.dataGridView1.Rows.AddRange(row);