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

Page 2 of 1

1 Answer 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 05 Jun 2012, 08:42 AM
Hi,

I use a RadGrid with my own filter implementation. The user can use a textbox to filter the result (only rows containing the keyword will be added to the datasource in the NeedDataSource event). Now I have the strange issue that if I am on page 2 and do a filter and I end up with a row count which is less than the page size (e.g. the page size is 25 and I have only 5 rows), the RadGrid will show "page 2 of 1" and displays no records. 
This only occurs if I grouped after a column, Without grouping, everything works fine.

I the DataBound event I can see that CurrentPageIndex is 1 and PageCount is 1, so something went wrong. Setting the CurrentPageIndex to "0" won't work.

I'm using Q3 2011,

1 Answer, 1 is accepted

Sort by
0
JP
Top achievements
Rank 1
answered on 06 Jun 2012, 01:38 PM
Finally I was able to solve this issue (but I still think it is a bug in the Grid).
In the Grid's DataBound event, you have to rebind in case the currentpage index is equal to the pageCount:
if (grid.CurrentPageIndex == grid.PageCount)
{
    grid.CurrentPageIndex = 0;
    grid.Rebind();
}
Tags
Grid
Asked by
JP
Top achievements
Rank 1
Answers by
JP
Top achievements
Rank 1
Share this question
or