Reputation: 21
I have a dgv that is populated with formatted data(backcolor). Ss soon as a user clicks on one of the headercells to re-order the rows all the formatting disappears. How can I set the headercells to be unclickable?
I tried e.handled = true, but that does not work as it is not part of the family...
Upvotes: 0
Views: 40
Reputation: 11115
You can set DataGridViewColumn.SortMode
property to NotSortable
.
For i As Integer = 0 To YourDataGridView.Columns.Count - 1
YourDataGridView.Columns(i).SortMode = DataGridViewColumnSortMode.NotSortable
Next i
Upvotes: 0