Gridview as Recycle Bin

Discussion in 'ASP .Net Web Controls' started by Barry L. Camp, Mar 3, 2008.

  1. Hey all... would greatly appreciate some gridview advice.

    I have a gridview set up in a classic Master/Details setup for
    entering/editing/deleting data...

    But now I've been tasked with making deleted records "recoverable" by
    marking them as deleted (simply a timestamp), then populating those in
    a new gridview as a separate "Recycle Bin" grid. Here there will be
    only two options: delete permanently (actual purge of the record) or
    recover/restore, which is simply removing the "delete mark" so that it
    may then reappear in the "regular" grid.

    The new gridview needs to reflect either operation (delete or restore)
    in the form of removing the row from the grid. Handling the delete
    permanently option is trivial, it invokes a method to call a remove
    operation.

    But for Restore, I also need to "delete" the "recovered row" from the
    "Recycle Bin" grid (because it would then be available in the
    "regular" grid. I've already got the BLL, DAL and sproc code handled.
    I'm just wondering how to implement this from the Gridview. I'd like
    to invoke the restore using one of the built-in commands, but can't
    seem to make it update the gridview and show as a deleted row like I
    can with the delete method, which is already used. Obviously gridview
    doesn't have two separate delete functions. So what do I do then?

    Any advice on how to implement this would be greatly appreciated.

    Thanks much.
    Barry L. Camp, Mar 3, 2008
    #1
    1. Advertising

  2. Barry L. Camp

    Stan Guest

    On 3 Mar, 13:24, "Barry L. Camp" <> wrote:
    > Hey all...  would greatly appreciate some gridview advice.
    >
    > I have a gridview set up in a classic Master/Details setup for
    > entering/editing/deleting data...
    >
    > But now I've been tasked with making deleted records "recoverable" by
    > marking them as deleted (simply a timestamp), then populating those in
    > a new gridview as a separate "Recycle Bin" grid. Here there will be
    > only two options: delete permanently (actual purge of the record) or
    > recover/restore, which is simply removing the "delete mark" so that it
    > may then reappear in the "regular" grid.
    >
    > The new gridview needs to reflect either operation (delete or restore)
    > in the form of removing the row from the grid. Handling the delete
    > permanently option is trivial, it invokes a method to call a remove
    > operation.
    >
    > But for Restore, I also need to "delete" the "recovered row" from the
    > "Recycle Bin" grid (because it would then be available in the
    > "regular" grid. I've already got the BLL, DAL and sproc code handled.
    > I'm just wondering how to implement this from the Gridview. I'd like
    > to invoke the restore using one of the built-in commands, but can't
    > seem to make it update the gridview and show as a deleted row like I
    > can with the delete method, which is already used. Obviously gridview
    > doesn't have two separate delete functions. So what do I do then?
    >
    > Any advice on how to implement this would be greatly appreciated.
    >
    > Thanks much.


    In addition to the standard commands for GridView you can create and
    handle your own. All you need is a link button in a template column
    with the CommandName property set to one of your choosing (e.g.
    "restore") and then set the CommandArgument to the primary key using
    databinding (Eval("fieldname") method). When clicked it will raise the
    RowCommand event. Place your data handling code there and get the key
    value from e.CommandArgument (which is passed as a special event
    argument parameter). When you've updated the record status execute the
    GridView.DataBind() method to refresh it.
    Stan, Mar 16, 2008
    #2
    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. Michael Foord

    Recycle Bin and Python

    Michael Foord, Oct 15, 2004, in forum: Python
    Replies:
    3
    Views:
    443
    Michael Foord
    Oct 15, 2004
  2. raghav

    app_offline in recycle bin

    raghav, Sep 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    424
    raghav
    Sep 28, 2006
  3. Roedy Green

    Empty recycle bin

    Roedy Green, May 30, 2007, in forum: Java
    Replies:
    3
    Views:
    673
  4. Barry L. Camp

    Gridview as Recycle Bin

    Barry L. Camp, Mar 3, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    285
    Barry L. Camp
    Mar 3, 2008
  5. anne001
    Replies:
    1
    Views:
    397
Loading...

Share This Page