Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Gridview as Recycle Bin

Reply
Thread Tools

Gridview as Recycle Bin

 
 
Barry L. Camp
Guest
Posts: n/a
 
      03-03-2008

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.
 
Reply With Quote
 
 
 
 
Stan
Guest
Posts: n/a
 
      03-16-2008
On 3 Mar, 13:24, "Barry L. Camp" <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview as Recycle Bin Barry L. Camp ASP .Net 0 03-03-2008 03:09 AM
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
Where do i find the recycle bin? XP PRO with norton protected bin Quiz Time Computer Support 6 06-27-2004 11:13 AM
Folder stuck in Recycle Bin Ivan MCSE 2 08-02-2003 03:08 AM
Re: nortons recycle bin? Šaz ©. Computer Support 0 06-24-2003 04:34 PM



Advertisments