如何对radgridview进行排序
我有一个 radgridview... 我想根据用户单击的按钮按升序/降序对它们进行排序。 我还有一个组合框,其中包含 radgridview 中的列名称,用户选择根据列名称对数据进行排序...
不幸的是,我不知道该怎么做...
你能帮我解决这个问题吗?
谢谢 :)
i have a radgridview...
i want to sort them in ascending/descending depending on the button that the user clicks.
i also have a combobox that contains the column names in the radgridview which the user chooses to sort the data based on the column names...
unfortunately, i don't know how to do it...
can you help m with this one?
thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是我的代码,按升序对 ID 进行排序:
在 gridview 中,列是 ID、名称、单价和日期...
希望用户选择要排序的特定列..
我有一个组合框,允许用户选择一列
但我无法获取所选组合框项目的值
here's my code that sorts the ID in ascending order:
in the gridview, the columns are ID, Name, UnitPrice, and date...
want the user to choose a specific column that which will be sorted..
i have a combobox that allows the user to choose a column
but i can't get the value of the selected combobox item
我已经解决了这个问题...
我添加了一个组合框,用户可以在其中选择要排序的字段。
这是我的代码:
这将按升序排序。要按降序排序,只需将升序替换为降序即可。 :)
i have solved this problem...
i added a combobox where users can select the field to be sorted.
here's my code:
this will sort in ascending order. to sort in descending order, just replace Ascending with Descending. :)
Telerik 的网站非常清晰,详细介绍了如何对 RadGridView 进行排序: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/sorting/defaultcs.aspx
你尝试过什么 远的?
Telerik's site is pretty clear and goes through a lot of detail on how to sort a RadGridView: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/sorting/defaultcs.aspx
What you have tried so far?