Question

I'm getting "The GridView 'grdFiles' fired event PageIndexChanging which wasn't handled." even if I've added the event handler:

protected void grdFiles_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GetFiles();
        grdFiles.PageIndex = e.NewPageIndex;
        grdFiles.DataBind();

    }

Any ideas?

Was it helpful?

Solution

Try this code. You need to declare a method on your code behind that handles the PageIndexChanging event.

protected void grdFiles_PageIndexChanging (object sender, GridViewPageEventArgs  e)
{
grdFiles.PageIndex = e.NewPageIndex;
bindGridView()
}

the method bindGridView() is

private void bindGridView()
{
 grdFiles.DataSource=.....;
 grdFiles.DataBind();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top