SvenLie
SvenLie

Reputation: 21

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

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

Answers (1)

tezzo
tezzo

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

Related Questions