I have a GridView Control in a UserControl. AllowPaging=True. The data source is assigned in page where the control is used, after declaring a Page.DataSource as public property. when i set the page.datasource property, I also call GridView.DataBind. Databinding works fine and data is displayed correctly.
OnPageIndexChanging event is handled by setting GridView.PageIndex=e.NewPageIndex. I am not binding the data after this, coz when I do that, no data is displayed in the grid at all.
But, when I click a page index (say 3) in a page where the control is used, the gridview page does not change. If i click another page index (say 7), then the grid navigates to the previous index (that is, 3)!
I put break points and found that the GridView_PageIndexChanging event is handled twice, but with correct index selected in the pager in each occasion. Otherwise, no error messages or other significant observations.
Can anyone help me resolve this?