8oris
8oris

Reputation: 453

Disable "first column header selected" in a datagridview

How to not having the header of the first column selected in a datagridview considering that the SelectionMode must be set to FullRowSelected .

I tried EnableHeadersVisualStyles to false but it didn't work.

enter image description here

Upvotes: 2

Views: 1042

Answers (1)

JohnG
JohnG

Reputation: 9469

Have you considered simply changing the grid's headers SelectionBackColor to the default “Control” color… something like…

dataGridView1.ColumnHeadersDefaultCellStyle.SelectionBackColor = Color.FromKnownColor(KnownColor.Control);

Upvotes: 4

Related Questions