Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个DataGridView允许通过单击列标题对行进行排序。我有一行希望免于排序;也就是说,我希望它保持在顶部。在每次排序事件后不重新排列表格的情况下这样做有什么诀窍吗?
DataGridView
将您的数据源设为 List<> 或表格,然后在排序之前,从列表中删除第一行,同时在变量中保留它,然后对列表(或表格)进行排序,然后再次添加该行。