Search code examples
c#asp.net.netgridviewpage-index-changed

PageIndexChanging in GridView in ASP.NET


I have a gridview which I am using to display a dataset result. The problem is I am using paging in it. But when I click on the page # it says that I haven't handled the event. Do I need to rebind the dataset???

Thanks


Solution

  • Try the following code:

    protected void grdView_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        FillGrid();
        grdView.PageIndex = e.NewPageIndex;
        grdView.DataBind();
    }