单击列标题时的Datagridview列排序

编程入门 行业动态 更新时间:2024-10-28 01:15:45
本文介绍了单击列标题时的Datagridview列排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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列排序

本文发布于:2023-11-04 06:40:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557219.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单击   标题   Datagridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!