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

Reset Page Index with RadDataPager

2 Answers 159 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Andy Macourek
Top achievements
Rank 1
Andy Macourek asked on 15 Dec 2010, 04:05 PM
I have a RadListViewcontrol that I bind to data.  I am also using two RadDataPager controls at top and bottom.  The binding works and the paging works.  However, when I rebind the list and the pager are set to a page outside of the results, the page disappears.  I tried using fireCommand("Page", "First") and set_currentPageIndex(1) on the client before I bind, but they are not working.  They error out in the jscript that the methods do not exists.  I am using version 2010.2.929.40 of the DLLS.  I am using NeedDataSource for binding.  I cannot seem to find a server method to reset page number.

2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 20 Dec 2010, 03:02 PM
Hello Andy,

I followed your scenario in the attached demo however was not able to replicate the issue. Can you check it out and let me know what differs in your case?

Best wishes,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Gaurab
Top achievements
Rank 1
answered on 22 Sep 2017, 08:41 PM

I had the same situation as Andy.  Here's how I was able to reset the page index to 0.

In the event handler that calls the Rebind method, find the RadDataPager control and set the CurrentPageIndex to 0.  Even though I had a top and bottom pager, resetting just the top caused the other to reset as well.

protected void rsbSearch_OnSearch(object sender, SearchBoxEventArgs e)
{
    RadListView1.Rebind();
    var RadDataPagerTop = (RadDataPager)RadListView1.FindControl("RadDataPagerTop");
    RadDataPagerTop.CurrentPageIndex = 0;
}
Tags
ListView
Asked by
Andy Macourek
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Gaurab
Top achievements
Rank 1
Share this question
or