禁用datagridview中的自动排序功能

把datagridview中的自动排序功能禁用
自己收集的两种方法,看看吧
①DataGridView中的Columns属性里面可以设置。进入“EditColumns”窗口后,在相应的列属性设置里面把SortMode属性选择为”NotSortable”
②          for (int i = 0; i < this.dataGridView1.Columns.Count;i++)
{
this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}

原文链接:http://www.cnblogs.com/whitetiger/archive/2007/04/12/710563.html

或者:在属性列中的SortMode属性选择为"NotSortable"就可以啦,很简单的。

原文地址:https://www.cnblogs.com/LastDance/p/6149008.html