-2

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?

4

1 回答 1

0

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();
}
于 2013-03-30T09:50:25.527 回答