vb.net winforms, what is the e.handled = true equivalent for anything to do with column headers in a dgv?

29 views Asked by At

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...

1

There are 1 answers

0
tezzo On

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