Gridview: Data does not change on page change.
Hi, im working on a asp.net website with c#.
I have a gridview with paging, the gridview is populated from an sql database, and on the PageIndexChanging I have:
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
BindGridControl();
gridView.PageIndex = e.NewPageIndex;
gridView.DataBind();
}
If I click on page 2 for example, the next rows of data display fine.
But if I click back to the page 1, the data does not change, it keep displaying the data from the page 2.
How can I solve this?
Is your BindGridControl() load the data and set it to your gridView datasource?