How to set paging in gridview

Posted on 2012-08-11
Last Modified: 2012-08-12
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.
Question by:Mehram
    LVL 20

    Expert Comment

    LVL 4

    Accepted Solution


    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 Comment

    I tried it but its not working. I have asked the same question after correct it. can you please see that?
    LVL 20

    Expert Comment

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

    Author Comment

    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:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now