0
您好我有一个Datagridview我想使网格无法排序时,用户单击列名称。 请帮助。禁用排序在Datagridview
您好我有一个Datagridview我想使网格无法排序时,用户单击列名称。 请帮助。禁用排序在Datagridview
你有2种选择:
通过DataGridView
的财产。转到编辑列并将SortMode选项更改为NotSortable。
通过代码。写下你想禁用排序的每一列。
dataGridView1.Columns[ColumnNumber].SortMode = DataGridViewColumnSortMode.NotSortable;