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.

undo row delete (clear)

Thread ID:

Created:

Updated:

Platform:

Replies:

11187 Feb 25,2004 10:51 PM Feb 29,2004 12:30 AM Windows Forms 3
loading
Tags: GridControl
simon
Asked On February 25, 2004 10:51 PM

Grid is not connected to data. A row is selected. On key up I test for the delete key and message box pop up to confirm. On cancel, I would like to restore the contents of the row. How can I do a "CurrentRow.CancelEdit" type behavior

Administrator [Syncfusion]
Replied On February 26, 2004 02:08 AM

If you have grid.CommandStack.Enabled = true so the grid''s undo support is enabled, then you can use this to rollback changes. The idea would be to call grid.CommandStack.BeginTrans when you start editing on a new row. You could try this in teh CurrentCellStartEditing event, but you would have to have a row variable to track the row being edited so you would know when you were starting on a new row. Then when you leave the row (say in CurrentCellMoved) you would call grid.CommandStack.CommitTrans to end the undo/redo transaction. If your user cancels the edit in your delete key code, you would call grid.CommandStack.Rollback to undo the changes.

Administrator [Syncfusion]
Replied On February 28, 2004 10:55 PM

Using the commandstack sounds right, I''ve searched your web site and help files, but could not find sample code to demomstrating how to push and pop on the stack. Any sample code?

Administrator [Syncfusion]
Replied On February 29, 2004 12:30 AM

Check out this sample. It has a menu/toolbar entry that Begins/Commits transactions. Syncfusion\Essential Suite\Grid\Samples\In Depth\UndoRedoSample

CONFIRMATION

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.

;