Datagridview column sorting when clicking on the c

2019-08-08 16:31发布

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 view column? I am working on a Windows application using C#.

Would anyone please help on this?

1条回答
干净又极端
2楼-- · 2019-08-08 16:38

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

查看更多
登录 后发表回答