Re: gridview edit and delete

Discussion in 'ASP .Net' started by Jonathan Wood, Jun 18, 2008.

  1. Convert the column in question into a template and then do something like
    this:

    <ItemTemplate>
    <asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="false"
    CommandName="Delete" Text="Delete"
    OnClientClick="return confirm('Are you sure you want to delete this
    record?');" />
    </ItemTemplate>

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com

    "J" <> wrote in message
    news:...
    >I like the Edit (Update, Cancel) functionality built into the gridview, but
    >I'd like to control what happens when the Update is clicked. I would like
    >to prompt the user with something like this "category has changed from
    >'something' to 'something else', shall I process related records?
    >(yes/no)". I would also like to confirm when a user clicks Delete.
    >
    > Here's how I currently have the gridview configured:
    >
    > <asp:GridView ID="gvMyGridView" runat="server" AllowSorting="True"
    > AutoGenerateColumns="False" DataKeyNames="BigId" DataSourceID="sdsMonday">
    > <Columns>
    > <asp:BoundField DataField="Stage" HeaderText="Description"
    > SortExpression="Stage" />
    > <asp:CommandField ShowEditButton="True" />
    > <asp:CommandField ShowDeleteButton="True" />
    > </Columns>
    > </asp:GridView>
    >
    > Thanks.
    >
    >
    >
     
    Jonathan Wood, Jun 18, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?a2Vu?=
    Replies:
    1
    Views:
    10,358
    Wiktor Zychla [C# MVP]
    Jan 23, 2006
  2. Learner
    Replies:
    2
    Views:
    2,145
    Learner
    Mar 13, 2006
  3. Remy
    Replies:
    2
    Views:
    8,574
  4. Jaime Stuardo

    GridView control enters edit mode when I click Edit link twice

    Jaime Stuardo, Apr 7, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    416
    Jaime Stuardo
    Apr 7, 2006
  5. Replies:
    0
    Views:
    230
Loading...

Share This Page