473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Undoing JUST the a row delete

I am trying to implement undo in an application. The problem is the user wants a granular undo like word or studio.

Here's the issue:
1. Bring up a record, and edit a field.
2. move to a new field and edit
3. delete the record
4. Now hit undo.

If I "undo" the delete using datarow.undo() or datarow.rejectchanges(), it reverts to the original state and I lose the changes fromstep 1 and 2. The user wants to be able to undo JUST the delete, and then udo the field changes with subsequent undo's if desired.

All I really want to do is set the row from rowstate=deleted back to rowstate=modified or unchanged. .net 2 has a setadded and setmodified, but these only work on rowstate=unchanged.

Anybody have any ideas how to handle this?

From http://www.developmentnow.com/g/36_0...ges-csharp.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Jan 6 '06 #1
2 2994
"Mike Fox" <no****@developmentnow.com> a écrit dans le message de news:
f9**********************************...icros oft.com...

|I am trying to implement undo in an application. The problem is the user
wants a granular undo like word or studio.
|
| Here's the issue:
| 1. Bring up a record, and edit a field.
| 2. move to a new field and edit
| 3. delete the record
| 4. Now hit undo.
|
| If I "undo" the delete using datarow.undo() or datarow.rejectchanges(), it
reverts to the original state and I lose the changes fromstep 1 and 2. The
user wants to be able to undo JUST the delete, and then udo the field
changes with subsequent undo's if desired.
|
| All I really want to do is set the row from rowstate=deleted back to
rowstate=modified or unchanged. .net 2 has a setadded and setmodified, but
these only work on rowstate=unchanged.

Add the row to your own "deleted" list when marking it as deleted, and then
remove it after restoring the state back to modified.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Jan 6 '06 #2
I implimented an undo function into one of my application by creating a
LIFO (last in, first out) collection of changes. You could store the
type of change it was (adding, removing, editing, etc), the unmodified
data ( like your datarow ), and then where the row was located. When
the user hits the 'undo' button you could call a function that take the
newest item from your undo collection and uses the information to undo
that change. This way the user could hit the Undo button multiple
times. Say your user wants to undo the edit he made right before
deleting that row; he could hit the 'undo' button twice and undo both
the delete and the edit. Just make sure you remove the undone item from
your collection or you'll end up undoing the same thing over and over.

This is just my two cents, though. :)

Jan 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nimmi Srivastav | last post by:
There's a rather nondescript book called "Using Borland C++" by Lee and Mark Atkinson (Que Corporation) which presents an excellent discussion of overloaded new and delete operators. I am...
11
by: DamonChong | last post by:
Hi, I am new to c++. I recently spend an enormous among of time troubleshooting a seeminly innocuous piece of code. Although I narrow down this piece of code as the culprit but I don't...
2
by: Dave | last post by:
Hello all, I'd like to find a source on the web that discusses, in a comprehensive manner and in one place, everything about new / delete. It should include overloading operator new, the new...
3
by: webdev | last post by:
Hi, Code below dynamically adds an input box to a form, creating a new name attribute as it goes... (many thanks to Martin Honnen for getting me this far ;0) Problem is - in IE5.5 only the first...
1
by: sparks | last post by:
At first I thought I could just delete the tables and import the tables. BUT my tables have relationships and I can not delete a table with relations. So that only deleted the non relational tables...
3
by: silver360 | last post by:
Hello, I'm trying to create a basic Heap manager and i have some question about new/delete overloading. The following code give me this output : >> $./heap >> registered : 0x804d098 >>...
4
by: stokefan | last post by:
Hi all, I wondered if anyone knew if it was possible to delete entries in an MS Access database table from just entering data into it? I shall explain : If you have a web form (in asp.net...
0
by: jatin vijay nahar | last post by:
how to undoing in richtextbox in c#.net
1
by: psyvanz | last post by:
any code that can delete all records in just one click if you have a dataenvironment code it more good.. cause im working in this kind of code. like this: single delete code (not all in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.