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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

undo row delete (clear)

Thread ID:





11187 Feb 26,2004 03:51 AM UTC Feb 29,2004 05:30 AM UTC WinForms 3
Tags: GridControl
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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon