Grid AJAX binding and paging

3 posts, 1 answers
  1. Nikita
    Nikita avatar
    9 posts
    Member since:
    Apr 2013

    Posted 31 May Link to this post

    I have a form that is used to search for people's names and display them in an Telerik MVC Grid. Grid uses Ajax binding and paging. I have a problem with paging. My situation is that when a user searches for names and the search returns say 3 pages of results. The user flips a page and performs a search again narrowing it down to say 1 page of the results, the grid refreshes but stays on the flipped page which shows up empty because again there is only 1 page of results. Is there a way to reset the paging after each search? I handle the searching explicitly on client side by calling $("#gridElement").data("kendoGrid").dataSource.read();

    Any help is appreciated.

    Nik

  2. Answer
    Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 02 Jun Link to this post

    Hello Nikita,

    To achieve the desired functionality you can try resetting the page manually just before filtering:
    $("#grid").data("kendoGrid").dataSource.page(1);

    On the following link I attached a small example which demonstrates the described approach.
    http://dojo.telerik.com/eseSu/5

    If you need further assistance, do not hesitate to contact us again.

    Regards,
    Radoslav
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Nikita
    Nikita avatar
    9 posts
    Member since:
    Apr 2013

    Posted 06 Jun in reply to Radoslav Link to this post

    That was helpful, thank you.
Back to Top