473,564 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.rejectc hanges(), 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=delete d back to rowstate=modifi ed or unchanged. .net 2 has a setadded and setmodified, but these only work on rowstate=unchan ged.

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 3006
"Mike Fox" <no****@develop mentnow.com> a écrit dans le message de news:
f9************* *************** **... icrosoft.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.rejectc hanges(), 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=delete d back to
rowstate=modifi ed or unchanged. .net 2 has a setadded and setmodified, but
these only work on rowstate=unchan ged.

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
9371
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 presenting below a summary of what I have gathered. I would appreciate if someone could point out to something that is specific to Borland C++ and is not...
11
1769
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 understand why. Can some guru help to enlighten me? Thank you. // I created an array of pointers to object pointers: Object ** obs = new Object * ;
2
2075
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 operator, placement, nothrow, arrays, etc... My books cover the topic, I've found FAQs on the web that cover the topic, and so on, but all the...
3
1316
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 form field (the hard-coded one) is recovered from the form, while with Mozilla/Firefox all fields are. The alert() just shows that the newly...
1
1778
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 and imported them. Now I am trying to relink the exported tables. this is the code I am using Public Function ReLink() As Boolean On Error...
3
4639
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 >> 0x804d008 _Delete unknown block >> registered : 0x804d138 >> 0x804d008 _Delete unknown block >> 0x804d098 _Delete ok
4
1709
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 for example) where you can enter details into the Access DB like "firstname", and "biography" etc, is it possible to enter a certain string in this...
0
835
by: jatin vijay nahar | last post by:
how to undoing in richtextbox in c#.net
1
2270
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 records) dataenvironment1.command1.delete thats all i can do... i want to know how to create a code that can delete all records code in just a...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.