Telerik RadGrid:网格客户端分页

发布于 2024-08-14 11:14:51 字数 662 浏览 3 评论 0原文

我有一个网络服务,它返回一些数据,我正在处理这些数据并将其用作我的 radgrid (telerik) 的数据源。数据源很大,想对其进行分页。当我在服务器端对其进行分页时,我发现了几个问题

  1. 我必须再次绑定网格以进行分页,这实际上意味着我必须再次调用 WS 来获取数据。这对我来说是一个昂贵的电话。我宁愿放弃分页的好处,而是将所有结果显示在同一页面中,除非它会有点笨拙

  2. 在回发期间 RadGrid1.Items.Count 恰好是分页的项目数(25-在我的例子中)这是预期的,因为数据源中的所有项目都没有被绑定。这当然不是问题。真正的问题是,我们有一些根据某些业务条件进行检查的复选框。稍后我们将其添加到我们的业务对象/数据库中。因此,如果用户尚未导航所有页面,则不会添加这些“选中的”项目,因为分页将网格中的“项目”限制为那些绑定到该特定页面索引的项目。

我的想法: 我宁愿有某种客户端分页,我们可以隐藏/显示内容,而不是每次都访问服务器并进行数据绑定。虽然它会返回所有结果,但用户界面不会笨拙,并且网格在回发期间将具有“所有项目”

有没有办法做到这一点?

如果它是一个常规的 asp.net gridView,有人可以给我指出一篇可以满足我的目的的好文章

Ram

PS:还有谁认为 radgrid 很疯狂? (不幸的是我没有做出这个选择)

I have a web service which returns me some data,I am massaging this data and using this as datasource for my radgrid (telerik). The datasource is quite large, and would like to paginate it. I found couple of problems when I paginate it in the server side

  1. I have to bind the grid again for pagination, which essentially means I have to make a call to WS again to get the data. This is an expensive call for me. I would rather forgo the benefits of pagination and would display all the results in the same page, except for it would be a bit clumsy

  2. During the postback RadGrid1.Items.Count happens to be the number of items getting paginated (25- in my case) which is expected as all the items in the datasource are not getting bound. This of course is not an issue. The real issue is that we have some checkboxes which get checked based on some business condition. We add this to our business object/DB later. So if the user has not navigated all the pages, these "checked" items do not get added as pagination limits the "Items" in the grid to those which get bound for that particular page index.

My Thoughts:
I would rather have some sort of client side pagination, where we can hide/show contents than going to the server and doing a databind every time. Though it will return all the results, the UI will not be clumsy and the grid would have "all the items" during postback

Is there a way to do it ?

If it were a regular asp.net gridView, can someone point me to a good article which would serve my purpose

Ram

PS: who else think radgrid is crazy ? (unfortunately I did not make this choice)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

没︽人懂的悲伤 2024-08-21 11:14:52

[我没有任何使用 RadGrid 和 Telerik 的经验,因此此解决方案可能/可能不适合您]

Silverlight 3 原生支持分页,您可以在 PagedCollectionView

BRIJ MOHAN 还写道关于如何利用此类以及其他很酷的功能(如列分组)的很好的教程。

http: //weblogs.asp.net/brijmohan/archive/2009/08/01/silverlight-3-datagrid-columns-grouping-using-pagedcollectionview.aspx

[I don't have any experience in using RadGrid as well as Telerik, so this solution may/may not work for you]

Silverlight 3 has native support for pagination, you can get more info at PagedCollectionView

BRIJ MOHAN also wrote a nice tutorial on how to leverage this class as well as other cool features like column grouping.

http://weblogs.asp.net/brijmohan/archive/2009/08/01/silverlight-3-datagrid-columns-grouping-using-pagedcollectionview.aspx

绝不服输 2024-08-21 11:14:51

最近,在我的项目实施过程中(特别是使用 RadControls 和 RadGrid 构建的项目),我发现了一个方便的示例,该示例展示了如何从 Web 服务获取网格数据并通过对该 Web 服务的单次调用来实现分页。查看:

http://demos.telerik。 com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx

迪克

Recently during my project implementation (which is built with RadControls and RadGrid in particular) I found a handy example that shows how to get grid data from web service and implement paging with a single call to that web service. Check it out:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx

Dick

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文