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 redo

Thread ID:





69232 Oct 19,2007 10:45 AM UTC Oct 24,2007 03:30 PM UTC WinForms 5
Tags: GridControl
Asked On October 19, 2007 10:45 AM UTC


I noticed for some odd reason that undo (Ctrl-Z) only works if I stay within the current cell. As soon as I click out of the cell that I just changed, it doesn't remember how to undo it anymore. The redo function seems to have a longer memory. Am I doing something wrong?

Administrator [Syncfusion]
Replied On October 19, 2007 11:52 AM UTC

The multilevel undo/redo support is only available in GridControl. Is this the control you are using?

For the bound grid like GridDataBoundGrid and GridGroupingControl, the undo does not retain a history. There, normally, the first undo resets the current cell and the second undo resets the entire record. But, if you are using settings like DirectSaveCellInfo = true in GridDataBoundGrid or ForceImmediateSaveValue = true in a GridGroupingControl, or if you are handling editing events and explicitly calling something like EndEdit, then this may also interfere with undos.

Replied On October 19, 2007 09:50 PM UTC


Is the DirectSaveCellInfo set true by default?

Replied On October 19, 2007 09:53 PM UTC


Sorry, I forgot to mention that I am using griddataboundgrid.

Administrator [Syncfusion]
Replied On October 20, 2007 07:21 AM UTC

The default value of DirectSaveCellInfo is false.

I tried things with a GridDataBoundGrid. I also see the second control Z not resetting the current record. But I think you can get this wroking by handling the keydown event and cancelling the edit on the binder if your user hits ctlZ on a editing row that does not have a editing currentcell. Here is a little sample.


Replied On October 24, 2007 03:30 PM UTC


I tried looking at the sample that was provided and I still can't get the second Ctrl-Z to do undo the second operation.

I specifically had trouble getting this part of the code to return a true value:

if(e.KeyCode == Keys.Z && e.Control
&& !gridDataBoundGrid1.CurrentCell.IsEditing
&& gridDataBoundGrid1.Binder.IsEditing)
return true; //never returns true

I tried just running this to see if I could get the second Ctrl-Z to undo, but it still wouldn't undo the operation.


I'm not sure what I'm doing wrong. =( Any help would be greatly appreciated. Thanks!


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

or the page will be automatically redirected to 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