gridview w/edit and delete buttons set to autogenerate

Posted on 2011-10-15
Last Modified: 2012-05-12

Can someone please point to a link or links where there is a *WORKING* example of GridView with Edit and Delete buttons are set to autogenerate, more like:

        <asp:GridView ID="GridView1" runat="server" DataSourceID="whatever" 
            AutoGenerateColumns="False" DataKeyNames="watever" AllowPaging="True" 
            CellPadding="4" ForeColor="#333333" GridLines="None" Visible="True" 

Open in new window

Important items on my wish list are:

AutoGenerateColumns="False"   AutoGenerateDeleteButton="True"   AutoGenerateEditButton="True">

I have been looking at one written by someone else for 2 days that I feel I am better coming up with a new one.

Question by:sammySeltzer
    LVL 38

    Accepted Solution

    There is no attribute like "AutoGenerateDeleteButton", but the wizards can make adding Edit and Delete buttons to a GridView fairly simple.
    LVL 35

    Assisted Solution

    by:Miguel Oz
    the attributes exist and when they (AutoGenerateEditButton and AutoGenerateDeleteButton)  are enabled,
    Edit and Delete links are automatically rendered next to each row in the GridView. Check:

    Just keep in mind that, if you are using a SqlDataSource  or ObjectDataSource you need to provide the UpdateCommand and DeleteComand as shown in the link examples
    LVL 28

    Author Comment

    Thanks guys.

    Unfortunately, none of these would work for what I am looking for - not you guys' fault.

    I will close this and post a question that is more appropriate for what i am after.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    754 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

    24 Experts available now in Live!

    Get 1:1 Help Now