We help IT Professionals succeed at work.

How to set paging in gridview

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

C # Code
code
Error:
error
Other Code
other codes
Please help how to fix it.
rgds.
Mehram
Comment
Watch Question

Obadiah ChristopherDeveloper User Interface
CERTIFIED EXPERT

Commented:
Hello,

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

Author

Commented:
I tried it but its not working. I have asked the same question after correct it. can you please see that?
Obadiah ChristopherDeveloper User Interface
CERTIFIED EXPERT

Commented:
Are you still getting the error PageIndexChanging event not handled? Or is it some other error.

Author

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:

http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_27825715.html

Explore More ContentExplore courses, solutions, and other research materials related to this topic.