I ran into this problem today. I wrote this method and called it on the form load event.
public void DisableGridviewSorting(DataGridView grid, int index)
{
//Index = DataGridView.Columns.Count
for (int i = 0; i < index; i++)
{
grid.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}
}
It looks like you are pretty much stuck looping through the DataGridView no matter how you do it, unless you use bound data. Then you can set non-sortable for each individual column.