From everything I\'ve read, it seemed that adding paging to a ListView control should be dead simple, but it\'s not working for me. After adding the ListView and DataPager contr
We need to databind list view again in OnPreRender event.
protected override void OnPreRender(EventArgs e)
{
ListView1.DataBind();
base.OnPreRender(e);
}
--Update
After working on a few list views with asp.net ajax, I saw a solution that makes more sense than the above one. You would normally data bind Listview on page load method or a button click event handler and when there is post back the data binding would be lost as described above in the problem. So, we need to data bind again on page properties changed event handler for the list view.
ListView_PagePropertiesChanged(object sender, EventArgs e)
{
ListView.DataSource=someDatasource;
ListView.DataBind()
}