This is a migrated thread and some comments may be shown as answers.

RadGrid - Pagination Problem - (Server Side Bind Breaking ClientSide Bind's Pagination

2 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 2
Jon asked on 29 Sep 2009, 09:02 AM

On a majority of my forms I Pre-Bind RadGrids on the Server, but after the form is loaded I use WebServices (asmx) and Client side binding to update the RadGrid using Client Side Binding.

My problem is Pagination does not working (or isn't visible) after a client side bind if the Radgrid was already bound to a list on the Server with a datasource <= to the radgrids pagesize. 

For Example 
My grid has a pagesize of 10. 
It was bound to Six records on the Pageload.
Then after the page has loaded the User proceeds to change the Search Criteria and invoke the WebService which returns 10 records with a Total Virtual count of 140. The 10 Records show up fine, column sorting works but no Pagingation is Visible.

If what is bound on the Server is greater then the Radgrids PageSize pagination works for future Client side binds.

Here is what my client side bind looks like:

var tableView = $find('<%= grdWorkItems.ClientID %>').get_masterTableView();                           
        tableView.set_virtualItemCount(result.TotalRecordCount);  
        tableView.set_dataSource(result.Records);                
        tableView.dataBind();                     
        tableView.clearSelectedItems();           

Have you guys seen this before am I missing something.

Thanks,
Marc

2 Answers, 1 is accepted

Sort by
0
Jon
Top achievements
Rank 2
answered on 29 Sep 2009, 09:30 AM
I came up with a workaround, basically I now no longer bind on the Server and instead do a client side bind in OnGridCreated. This works but I would rather have the form ready to go in the initial response.
0
Tsvetoslav
Telerik team
answered on 02 Oct 2009, 08:07 AM
Hi Marc,

You are correct in observing that when the page size set on the server (due to binding the grid to a number of records smaller than the page size) is less than the page size the grid expects when binding on the client - the grid will not behave correctly.

I have prepared a small sample demonstrating how you can achieve your scenario. Please, find it attached to this post.

Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Jon
Top achievements
Rank 2
Answers by
Jon
Top achievements
Rank 2
Tsvetoslav
Telerik team
Share this question
or