Jassim Rahma

how can disable the row select in the datagrid to prevent user from highlighting a row



Re: Windows Forms General how to disable row select in datagridview?

Christopher Payne

Try setting the SelectionMode = CellSelect. The user will still be able to select a cell, but it shouldn't highlight the whole row when they do it.

I'm not sure if they'll still be able to highlight the row by clicking on the row header, so you might have to look at that.





Re: Windows Forms General how to disable row select in datagridview?

Gavin Jin - MSFT

Hi,how about this ,set the same backcolor and forecolor as normal.

Me.DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
Me.DataGridView1.DefaultCellStyle.SelectionBackColor = Color.White
Me.DataGridView1.DefaultCellStyle.SelectionForeColor = Color.Black

With Regards