仅对GridView中的当前页面进行排序。 [英] Sort only the current page in a GridView.

查看:77
本文介绍了仅对GridView中的当前页面进行排序。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常希望能够在GridView中对当前显示的页面(即20个奇数记录)进行排序。这种方式通常更有意义,特别是在排序以更快地定位记录的目标时。是否有任何实现或模式我可以寻求灵感来实现这个目标?

I would very much like to be able to sort just the currently displayed page, i.e. 20 odd records, in a GridView. It often makes more sense this way, especially when the goal of sorting to more quickly locate a record. Are there any implementations or patterns I can look to for inspiration in going about achieving this?

推荐答案

我不知道,我会不同意你的意见,排序不应该特定于当前页面,这会误导用户,因为他正在寻找对整个数据进行排序,如果所有人都在一个页面中作为排序,我不会从AD调用排序记录,我期待Z的记录当我按顺序排序时开始显示。
I don't know, I would disagree with you on this, sorting shouldn't be specific to the current page, this will mislead the user eventually since he is looking for sorting to the whole data, I won't call sorting records from A-D if all fit in one page as sorting, I expect records of Z start showing when I sort descendingly.


我找到了一个最好的解决方案,用于在asp.net中仅对gridview中的当前页面进行排序



步骤: -



1)在数据表中复制gridview的结构。

2)然后在datatable中复制gridview的数据。

3)将数据表转换为数据视图(数据表没有排序方法)。

4)按排序方法对数据视图排序。

5 )然后再次将数据表中的排序数据分配给gridview(而不是通过数据源)。



浏览链接阅读更多内容: -



仅在asp.net的gridview中排序当前页面

I have found a best solution for how to sort only current page in gridview in asp.net

Steps:-

1)Copy structure of the gridview in a datatable.
2)Then copy data of gridview in datatable.
3)Convert datatable to dataview (datatable doesn't have sort method).
4)Sort dataview by sort method.
5)Then again assign sorted data from datatable to gridview (not through datasource).

Go through the link to read more :-


Sorting only current page in a gridview in asp.net


这篇关于仅对GridView中的当前页面进行排序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆