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 ?
No, I think setting the SortMode on the column directly is as good as it gets. But honestly, who cares? What's so bad about a simple loop?