GridView different Page view problem – Visual Studio, ASP.NET

Tags:
ASP.NET
ASP.NET 3.5
Visual Studio
Visual Studio 2008
definition of question are as follows: [HttpException (0x80004005): The GridView 'GridViewsearch' fired event PageIndexChanging which wasn't handled.] System.Web.UI.WebControls.GridView.OnPageIndexChanging(GridViewPageEventArgs e) +1495955 System.Web.UI.WebControls.GridView.HandlePage(Int32 newPage) +83 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +467 System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +199 System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

Software/Hardware used:
Asp.net 3.5 version, visual studio 2008

Answer Wiki

Thanks. We'll let you know when a new response is added.

You need to manage the PageIndexChanging event of your datagrid, and add some code in it to assign the new page index, and bind the datasource to the control.

Something like this:

<pre> Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
GridView1.DataBind()
End Sub</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following