Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Team,

I want to move Last few changes If I click Undo button in GUI Level.

Page having Two Different Sections,
Section 1: 
            Data Grid View Control (for Displaying all Customer Detail with Editing Option)

Section 2: 
            Data Grid View Control (for Displaying all Store Detail with Editing Option)

Explain:
       Now I edited few records in Customer Data Gridview, once I saved these records in this Section 1; Then I moved to Section 2 Store Details for edit some records. 
User want to move/see last few changes using Undo Operation, How to see the user changes in clicking Undo option.

---
How to implement undo option in this scenario, 

Thanks in Advance.
Posted
Updated 3-Apr-14 19:36pm
v4

1 solution

What you're looking for is called a Memento pattern[^].

It's not really difficult to implement such pattern, the trick is to keep tracking your changes and the ability to undo those changes.

Here are some examples, available on this very site:
Memento Design Pattern[^]
Generic Memento Pattern for Undo-Redo in C#[^]
Multilevel Undo and Redo Implementation in C# - Part I (Using Single Object Representing Change Approach)[^]
Multilevel Undo and Redo Implementation in C# - Part II (Using Command Pattern)[^]
Multilevel Undo and Redo Implementation in C# - Part III (Using Memento Pattern)[^]
 
Share this answer
 
Comments
CPallini 3-Apr-14 4:15am    
5.
Maarten Kools 3-Apr-14 4:16am    
That was rather quick, thanks! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900