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

Page size drop down doesn't work with custom binding

2 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Craig Quillen
Top achievements
Rank 1
Craig Quillen asked on 05 May 2011, 09:16 PM
I have a grid configured as follows:

htmlHelper.Telerik().Grid(Rows)
.EnableCustomBinding(true)
.Name("grid")
.PrefixUrlParameters(false)
.Pageable(pager => pager
.Style(GridPagerStyles.NextPreviousAndInput | GridPagerStyles.PageSizeDropDown)
.Total(TotalRecords)
.PageSize(10, new[]{10,25,50})
);

My prev/next buttons and the page number input box work fine.  However, the page size drop down does not.  

Picking a new value from the drop down does refresh the page, but the "size" query string parameter does not change to reflect the selected value.

I'm using 2011.1.315 GPL version.

2 Answers, 1 is accepted

Sort by
0
Stefan
Top achievements
Rank 1
answered on 16 May 2011, 12:41 PM

As far as I can tell the culprit is a faulty urlFormat generated somewhere during initialization of the Grid.
urlFormat:'/WebUI/House?house-grid-page=%7B0%7D&house-grid-orderBy=%7B1%7D&house-grid-groupBy=%7B2%7D&house-grid-filter=%7B3%7D&house-grid-size=5'
As you can see, PageSize is hardcoded to whatever your initial PageSize is, instead of {4}.

Later is used (at least) in function serverRequest()  in the following manner:
$t.formatString(unescape(this.urlFormat), this.currentPage, this.orderBy || '~', this.groupBy || '~', encodeURIComponent(this.filterBy) || '~', this.pageSize || '~');

Which of course translates to:
$t.formatString("/WebUI/House?house-grid-page={0}&house-grid-orderBy={1}&house-grid-groupBy={2}&house-grid-filter={3}&house-grid-size=5", ...);

So, yeah, I don't know where the initial urlFormat is defined and emitted into the markup, so I don't know how to fix this properly.
0
Henry
Top achievements
Rank 1
answered on 24 Mar 2012, 11:31 AM
This issue still exists in 2011.Q2.914
Tags
Grid
Asked by
Craig Quillen
Top achievements
Rank 1
Answers by
Stefan
Top achievements
Rank 1
Henry
Top achievements
Rank 1
Share this question
or