• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

gridview w/edit and delete buttons set to autogenerate

Hi,

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" 
             AutoGenerateDeleteButton="True" 
            AutoGenerateEditButton="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.

Thanks
0
sammySeltzer
Asked:
sammySeltzer
2 Solutions
 
Tom BeckCommented:
There is no attribute like "AutoGenerateDeleteButton", but the wizards can make adding Edit and Delete buttons to a GridView fairly simple.

http://csharpdotnetfreak.blogspot.com/2009/05/gridview-sqldatasource-insert-edit.html
0
 
Miguel OzSoftware EngineerCommented:
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:
http://www.java2s.com/Code/ASP/ADO.net-Database/AddingtheAutoGenerateEditButtonattributetoaSqlDataSourcecontrol.htm
http://www.java2s.com/Tutorial/ASP.NET/0380__Data-Binding/EditingData.htm

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
0
 
sammySeltzerAuthor Commented:
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.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now