Domanda

hi my dear friends :
how can i change the RadDataPager(telerik) Page# From CodeBehind (server-side)?
mean change the current page to another!

i can find it like below :

var raddatapager = (RadListViewImages).FindControl("RadDataPager1") as RadDataPager;

but now how can i change the page?

raddatapager .????????????

i couldn't find a way from it's demo!

thanks a lot
best regards

È stato utile?

Soluzione

You can use the FireCommand method to force a page change. Simply pass in "Page" as the CommandName and the page number as the CommandArgument:

var pager = RadListViewImages.FindControl("RadDataPager1") as RadDataPager;
if (pager != null)
{
    int pageNumber = GetNewPageNumber();
    pager.FireCommand("Page", pageNumber.ToString());
}

Other options for the CommandArgument are "First", "Next", "Prev", and "Last" to go to the first page, the next page, the previous page, or the last page, respectively.

See the Telerik documentation for details.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top