把datagridview中的自动排序功能禁用

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

posted on 2013-12-07 10:24  yeren  阅读(598)  评论(0编辑  收藏  举报