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

PageSize and custom pager templates

4 Answers 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Bough
Top achievements
Rank 1
Steve Bough asked on 01 Sep 2008, 01:18 PM
I've run into a weird little problem with page sizes and a custom pager template.
I'm using the javascript supplied in the sample http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/Programming/PagerTemplate/DefaultCS.aspx
to change page number and page size, which works perfectly fine.
The problem is that when I construct the Grid initially (i.e. !IsPostBack) I'm setting grid.PageSize and grid.MasterTableView.PageSize to 30 (our preferred default).
That works fine until I hit a page change link when the page size subsequently resets itself back to the default value 10.
If I change the page size from the client, the new page size is retained on subsequent post-backs, otherwise it remains at 10.
It looks like the viewstate value of the page size is somehow not picking up the server side change despite it being done before the grid is added to the control tree.

Is there any way around this problem, perhaps something else I can set server side which will fix it?
I can provide a simple example if that helps.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Sep 2008, 03:14 PM
Hi Steve,

Please set PageSize to the grid instead of MasterTableView and let me know how it goes.

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve Bough
Top achievements
Rank 1
answered on 01 Sep 2008, 03:17 PM
I'm actually setting both of them since I wasn't sure which one was important. Doesn't seem to help.
0
John
Top achievements
Rank 1
answered on 01 Sep 2008, 11:55 PM
Hello,

I am telerik fans. at the moment i still could not create customized page navigation on the telerik grid. Is there any one where want to get me the example on how to customized the page navigation on the grid in small project file.

Cheers,

JOHNG
0
Princy
Top achievements
Rank 2
answered on 02 Sep 2008, 04:24 AM
Hello John,

Check out this online demo which demonstrates how the PagrerItems can be customized using a template.
PagerTemplate

Princy.
Tags
Grid
Asked by
Steve Bough
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Steve Bough
Top achievements
Rank 1
John
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or