Install PageIndex of DataPager
I have a ListView that I view using a DataPager. I would like to set the initial pager page to page_Load. I tried the DataPager.SetPageProperties method, but it doesn't do what I need. This is how I call this method:
dataPager.SetPageProperties(3, dataPager.TotalRowCount, false);
The line above truncates the data source to start at the third item, and the paging still starts at 1. This is not what I want. I want to keep the entire list of items and just navigate to a specific page in the list.
Is there any other DataPager and / or ListView property and / or method that I should be using?
Any help would be greatly appreciated.
Thanks!
a source to share
If you are binding your datasource by code, you can manually set the PageIndex parameter in the binding method.
grd.DataSource = something ..
grd.PageIndex = initialIndex;//where initialIndex is the index you wish to set
//you can arrange this index in your code,it up to you actually.
grd.DataBind();
Before you bind data, you need to set a new page index.
Best wishes
Myra
a source to share