开发者

Datagridview column sorting when clicking on the column header

开发者 https://www.devze.com 2023-03-29 11:51 出处:网络
I have a datagridview with two columns name and price. 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 t

I have a datagridview with two columns name and price.

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 vie开发者_开发知识库w column? I am working on a Windows application using C#.

Would anyone please help on this?


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.

EDIT:

If not javascript, then you can use the following guide: DataGrid sort

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号