[英]Unsort Windows Forms DataGridView
This Function: 此功能:
dataGridView.Sort(this.dataGridView.Columns[1], ListSortDirection.Descending);
lets me sort a DataGridView
and its works. 让我对
DataGridView
及其作品进行排序。
But as the story goes, the user can unsort this view. 但是随着故事的发展,用户可以取消对此视图的排序。
There is no Databinding. 没有数据绑定。 The view gets a
List
and adds it, row by row. 该视图获取一个
List
并将其逐行添加。
So how do I unsort this DataGridView
? 那么,如何对该
DataGridView
进行排序?
使用以下代码取消排序:
this.dataGridView1.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.