Hi,
I'm having a problem with radgrid and i couldn't find a general solution. Here is the scenario:
I have a search page that binds results to grid. pagesize=10. first query returns 11 elements so grid is 2 pages. i'm selecting second page then search again which returns 1 element. here is the problem, radgrid stuck at second page and i don't want to show "No records to display" message, i just want to reset page to 1.
I can do it by:
| protected void btnSearch_Click(object sender, EventArgs e) |
| { |
| grdBank.CurrentPageIndex = 0; |
| grdBank.Rebind(); |
| } |
however, i'm using this grid in more than 100 pages which all have this problem. i don't want to put this code in every page. So i created my own custom pager as described here: http://www.telerik.com/help/aspnet-ajax/grdprogrammaticpagercustomization.html but this also has same problem.
i tried to reset page by "e.Item.OwnerTableView.CurrentPageIndex = 0;" in "protected override void OnItemEvent(GridItemEventArgs e)" which works as expected but caused another problem that i can't go to page 3 which is also expected...
how can i solve it in pager? on which event should i reset page?
Thanks