Please study this scenario:
The solution is easy, after launch search set manually CurrentPageIndex to:
a) First page
b) Last page
c) Last page, only if the new datasource has less rows
d) ...
I think that CurrentPageIndex must be updated in this cases to last page (or first page) of new datasource (equal to in pager mode advanced) or at least throw and exception, because find this little "error" is difficult (i spent a lot of minutes).
- Bind grid data at OnNeedDataSource event with a simple datatable.
- RadGrid allow paging, with PageSize = 10 items (for example)
- At top of grid some controls (textboxes, comboboxes, etc.) for filter grid rows.
- Launch search and found 1000 items (10 items per 10 pages).
- Go to last page.
- Launch search and found 20 items (10 item per 2 pages)
- Oh my god!!! Nothing ??? No rows returned ??? How it's possible? If I set a breakpoint at NeedDataSource event, grid datasource has 20 rows !!!
The solution is easy, after launch search set manually CurrentPageIndex to:
a) First page
b) Last page
c) Last page, only if the new datasource has less rows
d) ...
I think that CurrentPageIndex must be updated in this cases to last page (or first page) of new datasource (equal to in pager mode advanced) or at least throw and exception, because find this little "error" is difficult (i spent a lot of minutes).