views:

1253

answers:

2

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)

A: 

[I don't have any experience in using radgrod 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

Jay Zeng
A: 

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

I cannot call the WS directly, I would have to massage the data.And this part of the code is in a user control which gets added dynamically to page. And am afraid that we cannot have a web method in user control. http://www.dotnetmonster.com/Uwe/Forum.aspx/asp-net-web-services/5849/Web-methods-in-user-controls
ram