November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
The solution here seems to be to use the select method of the SearchDataSource in the code behind of your page:
1. In the OnPreRender event of your page do your initial databinding e.g.:
myListView.DataSource = mySearchDataSource.Select(DataSourceSelectArguments.Empty);
myListView.DataBind();
2. Add an event handler for your ListView's PagePropertiesChanged event to rebind the ListView e.g.:
private void myListView_PagePropertiesChanged(object sender, EventArgs e)
{
myListView.DataSource = mySearchDataSource.Select(DataSourceSelectArguments.Empty);
myListView.DataBind();
}
Bingo, your DataPager should now work correctly.
Robert
Confirmed. Without this I was unable to get DataPager to work with SearchDataSource (it shows first page no mater what i put in the querystring)
Hi,
Can anyone confirm if the SearchDataSource control supports paging functionality with the ASP.NET DataPager and ListView controls?
I'm trying to get them to work together with no joy. Basically, when I click on say, page 2 of the pager, the same results are shown on page 2 as were shown on page 1. The DataPager certainly restricts the page size, e.g. if I tell it to return 10 items per page this does seem to work.
I have run into this problem before when not using SearchDataSource and it was solved by re-binding the ListView on the PagePropertiesChanged event. This does not seem to work in this case.
Any ideas or comments?
Thanks a lot,
Robert