Click to See Complete Forum and Search --> : DataGridView Selected Row


rliq
August 23rd, 2007, 09:14 PM
I have a DataGridView control with the FullRowSelect SelectionMode, chosen (MultiSelect=False). So I select a row and all cells in that row go blue.

I don't want the left-hand cell to go blue when I select a row, as this cell is colour-coded (background colour of cell is either red or green and I want the cell to stay that colour even when selected)

Does anyone have any idea which event to handle to prevent this?

Thanks

rliq
August 23rd, 2007, 10:46 PM
ok - turned out to be straighforward.

Whenever you set:
row.Cells["MyColumn"].Style.BackColor = Color.Green;
at the same time set:
row.Cells["MyColumn"].Style.SelectionColor = Color.Green;