Paging with client side binding

7 posts, 0 answers
  1. Dewang Shah
    Dewang Shah avatar
    16 posts
    Member since:
    Jan 2010

    Posted 22 Oct 2010 Link to this post

    I am binding my grid dynamically on the client side with JSON data similar to this example However I cannot get paging to work.

    There is no mention on this page of any limitations with paging. I have 25 items in my datasource and the page size is set to 10. However my grid footer shows " Page 1 of 2, items 1 to 10 of 11. " when displaying all 25 items.
    <telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" PageSize="10">

    Do I need to specify anything else to get it to show the correct number of records?
  2. Veli
    Veli avatar
    2002 posts

    Posted 27 Oct 2010 Link to this post

    Hi Dewang,

    You also need to set the total number of items your service can return using the set_virtualItemCount()  property of the MasterTableView object. If your web service request's OnSuccess handler function is called updateGrid() (like in the example), you need to return the total row count in your service response and update the master table's virtual item count:

    function updateGrid(result)
        //assume contains the grid data
        //while result.count contains the total row count
        var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();

    This should update the grid pager with the correct number of items and pages.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Pramod
    Pramod avatar
    2 posts
    Member since:
    Dec 2013

    Posted 20 Dec 2013 Link to this post

    Grid is not binding properly after setting the Virtual Item count. Can you tell us the solution as soon as possible
  4. Pramod
    Pramod avatar
    2 posts
    Member since:
    Dec 2013

    Posted 20 Dec 2013 Link to this post

        After setting the Virtual Count 

                            function OnGetCaseDetailsSuccess(DoctorList, status) {
                                var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();

    All items are binding in First Page where as Page Size is 10.
  5. Eyup
    Eyup avatar
    3320 posts

    Posted 25 Dec 2013 Link to this post

    Hello Pramod,

    Can you please verify that you are closely following the recommendations provided in this article?

    It would be best if you open a support ticket to send us a very basic runnable web site along with a dummy source demonstrating the problematic behavior. Thus, we will be able to further analyze and debug the application and suggest a proper solution.

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 18 Dec 2014 in reply to Eyup Link to this post

    Seriously???  That much code to go from 10 to 25 rows in your GridView?
  7. Joe
    Joe avatar
    16 posts
    Member since:
    Oct 2013

    Posted 06 Jan 2015 Link to this post


    Has anyone actually come up with a solution to this issue? Having the exact same problem with the ItemTemplate control and getting zero answers from these forums. It seems like client-side binding isn't worth it with all these issues that are thrown by basic embedded controls.

    - Joe
Back to Top