How to set paging in gridview

I am using below mentioned code which is showing data in gridview perfectly. However, the paging is showing error

C # Code
Other Code
other codes
Please help how to fix it.
Who is Participating?
Friman001Connect With a Mentor Commented:

On the *.aspx page you need to have a property set to handle the trigger of the paging event. Right now, you have the method in the code behind file to handle that event, but it will never get called because the actual GridView never handles the triggered event.

So, you could just put "onpageindexchanged="GridView1_PageIndexChanged" in to the GridView tag or you can click on the GridView in Design mode in VS2010, press F4, and in the properties window click the yellow lightning bolt. This will show you the entire event driven properties of the GridView. If you click in the "OnPageIndexChanged" value back, you will see a dropdown arrow. Select that and you will see all of the possible methods that you could call. Find yours and select it (or double click in the value box and it will auto-generate a method for you!)

Ryan F
Obadiah ChristopherCommented:
MehramAuthor Commented:
I tried it but its not working. I have asked the same question after correct it. can you please see that?
Obadiah ChristopherCommented:
Are you still getting the error PageIndexChanging event not handled? Or is it some other error.
MehramAuthor Commented:
No, the error is no more but on click page, 2,3, or any one else the grid disappear to the page silently without showing any error. My present code you can refer here:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.