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?

Était-ce utile?

La 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();
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top