We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GGC binding to business object and CommandStack

Thread ID:





53019 Dec 7,2006 03:09 AM Dec 8,2006 09:46 AM Windows Forms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On December 7, 2006 03:09 AM

Hi together,

I am using a GGC which is bound to a business object (BindingList). Now I want to use the CommandStack option for undo and redo operations. So I activated the commandstack via:

ggc.TableModel.CommandStack.Enabled = true;

After I changed a cell value I do the following in my undo method:

if (!ggc.TableModel.CommandStack.InTransaction)

So Undo() is called but the cell value remains. What do I have to implement in my business object to support the commandstack?

Thank's for any help


Administrator [Syncfusion]
Replied On December 8, 2006 04:05 AM

The GGC does not support the Undo/Redo architecture that is provided by GridControlBase. So, if you want to use this Undo/Redo support, you would have to add custom commands (derived from the abstract GridModelCommand) to manage the actions you want to support. Here is a minimal sample showing one way to handle undo/redo on user changed values. It uses a TableControlCurrentCellValidating to cache the old value, and TableControlCurrentCellAcceptedChanges to create an instance of the custom command and push it on the CommandStack. I also had to manually manipulate the Undo and Redo stacks.


Administrator [Syncfusion]
Replied On December 8, 2006 09:46 AM

Hi Clay,

nice to "read" from you - Your example is great, thanks a lot.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.