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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

undo row delete (clear)

Thread ID:

Created:

Updated:

Platform:

Replies:

11187 Feb 26,2004 03:51 AM UTC Feb 29,2004 05:30 AM UTC WinForms 3
loading
Tags: GridControl
simon
Asked On February 26, 2004 03:51 AM UTC

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 07:08 AM UTC

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 29, 2004 03:55 AM UTC

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 05:30 AM UTC

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.

Warning Icon 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.Close Icon

;