how change the RadDataPager Page# From CodeBehind (server-side)
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?
raddat开发者_JAVA百科apager .????????????
i couldn't find a way from it's demo!
thanks a lot
best regardsYou 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.
精彩评论