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

Retaining Page Size

3 Answers 212 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shreesh
Top achievements
Rank 1
Shreesh asked on 04 May 2015, 02:43 PM

 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)

                                         )

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 06 May 2015, 11:14 AM
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.

 
0
Shreesh
Top achievements
Rank 1
answered on 13 May 2015, 12:46 PM

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.

0
Vladimir Iliev
Telerik team
answered on 14 May 2015, 09:22 AM
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
Tags
Grid
Asked by
Shreesh
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Shreesh
Top achievements
Rank 1
Share this question
or