gridview edit and delete

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J

    gridview edit and delete

    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="gvMyGridVie w" runat="server" AllowSorting="T rue"
    AutoGenerateCol umns="False" DataKeyNames="B igId" DataSourceID="s dsMonday">
    <Columns>
    <asp:BoundFie ld DataField="Stag e" HeaderText="Des cription"
    SortExpression= "Stage" />
    <asp:CommandFie ld ShowEditButton= "True" />
    <asp:CommandFie ld ShowDeleteButto n="True" />
    </Columns>
    </asp:GridView>

    Thanks.



  • Jonathan Wood

    #2
    Re: gridview edit and delete

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

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

    --
    Jonathan Wood
    SoftCircuits Programming


    "J" <nobody@nowhere .comwrote in message
    news:17ednUPMRM dhnMXVnZ2dnUVZ_ r7inZ2d@posted. nuvoxcommunicat ions...
    >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="gvMyGridVie w" runat="server" AllowSorting="T rue"
    AutoGenerateCol umns="False" DataKeyNames="B igId" DataSourceID="s dsMonday">
    <Columns>
    <asp:BoundFie ld DataField="Stag e" HeaderText="Des cription"
    SortExpression= "Stage" />
    <asp:CommandFie ld ShowEditButton= "True" />
    <asp:CommandFie ld ShowDeleteButto n="True" />
    </Columns>
    </asp:GridView>
    >
    Thanks.
    >
    >
    >

    Comment

    Working...