Retaining Page Size

4 posts, 0 answers
  1. Shreesh
    Shreesh avatar
    33 posts
    Member since:
    Aug 2011

    Posted 04 May 2015 Link to this post

     I would like to know how to retail the page size that is selected in the pager?

    Suppose I select 20 as pagesize on a list page.

    I do editing of a row by opening a new page.

    Then I come back after completing editing on the list page. Here the count again becomes default (i.e 10)  and not 20. How do I preserve this or make this work? I have items more than 10...

     I tried both the options give below but nothing seems to be working... Please provide solution.

     .Pageable(pager => pager.PageSizes(new int[] { 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 100, 200, 500 }))

     
                                          .Pageable(pageable => pageable
                                              .Refresh(true)    //false also tried..
                                          .PageSizes(new int[] { 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 100, 200, 500 })
                                          ////.Input(true)

                                             )

  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2206 posts

    Posted 06 May 2015 Link to this post

    Hello Shreesh,

    In your current scenario I would suggest to save the Grid state and restore it when the user gets back to the original page. Such examples are available in our CodeLibrary:

    Regards,
    Vladimir Iliev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. Shreesh
    Shreesh avatar
    33 posts
    Member since:
    Aug 2011

    Posted 13 May 2015 in reply to Vladimir Iliev Link to this post

    I used the option to "Save Grid State in session on server". However when I load the grid, the custom toolbar is lost. I get the correct pagecount but toolbar is lost.

    I referred to answer given by Telerik's Daniel with  link http://www.telerik.com/forums/save-load-grid-state-b6b3101b0dd3.

    I used toolbar as given in the code:

    var toolbar = $("#KendoGrid1").find(".k-toolbar").html();

    $("#KendoGrid1")
                   .empty()
                   .kendoGrid(options)
                    .find(".k-toolbar").html(toolbar);

    But I did not get toolbar.. How do I get the custom toolbar? If I don't get toolbar then usage of my software gets badly affected.

  4. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2206 posts

    Posted 14 May 2015 Link to this post

    Hello Shreesh,

    I would suggest to check the following demo in our CodeLibrary which shows different approach of preserving the toolbar when using the "setOptions" method of the Grid:

    Regards,
    Vladimir Iliev
    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
Back to Top