Best way to disable the column header sorting in DataGridView [duplicate]

This question already has an answer here:

I need to disable the column header sorting in DataGridView.

We can do that by setting the property of individual columns like

BalancesGridView.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;

If this is the case , then I'll have to loop through all the columns.

Is there a better way ?

28
задан decyclone 2 December 2010 в 12:35
поделиться