单击列标题时的Datagridview列排序 [英] Datagridview column sorting when clicking on the column header
问题描述
我有一个datagridview
,其中有两列name
和price
.
I have a datagridview
with two columns name
and price
.
如果单击列标题,则对应的列将按字母顺序排序.我是否需要添加任何事件处理程序以对datagrid视图列进行排序?还是有任何属性可以设置以对datagrid视图列进行排序?我正在使用C#开发Windows应用程序.
If I click on the column header, the corresponding column will be sorted in alphabetical order. Do I need to add any event handler for sorting the datagrid view column? Or is there any property to set for sorting datagrid view column? I am working on a Windows application using C#.
有人可以帮忙吗?
推荐答案
如果可以使用javascrip/jQuery,建议您使用JQuery插件 Datatabe .
If you could use javascrip/jQuery I would suggest you to use the JQuery plugin Datatabe.
这样一来,您就可以对列进行排序,列重新排序,过滤和搜索.
With that you can get the colum sorting, colum reordering, filtering and search all together.
如果不是javascript,则可以使用以下指南: DataGrid排序
If not javascript, then you can use the following guide: DataGrid sort
这篇关于单击列标题时的Datagridview列排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!