Whenever I connect GridView control to my local database and make AllowPaging property "True" the error coemes like this:
" The GridView 'GridView2' fired event PageIndexChanging which wasn't handled. "
But when I connect it via a Sqldatasource control it works fine. Why it happens? Any idea?

2 answers
Hi try to add the following code..
protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView2.PageIndex = e.NewPageIndex;
BindGrid();
}
sorry, you've to bind the grid. mistakenly i've given the method BindGrid. thing is availability of datasource.
hope it helps,
Anil
answered one year ago by:
57
Thanks for answering. But unfortunately it's not working. The error comes like this : the name "BindGrid" does not exist in the current context.
Besides, I want to know why this thing happens?
When there is a Datasource control like SqlDatasource serves in between, the AllowPaging property works fine but when I manually connect a GridView control directly to the Database, it gives that error:
"The GridView 'GridView2' fired event PageIndexChanging which wasn't handled."
answered one year ago by:
226