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 redo

Thread ID:

Created:

Updated:

Platform:

Replies:

69232 Oct 19,2007 06:45 AM Oct 24,2007 11:30 AM Windows Forms 5
loading
Tags: GridControl
John
Asked On October 19, 2007 06:45 AM


Hi,

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 07:52 AM

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.

John
Replied On October 19, 2007 05:50 PM


Hi,

Is the DirectSaveCellInfo set true by default?

John
Replied On October 19, 2007 05:53 PM



Hi,

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


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

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.

WindowsApplication25.zip

John
Replied On October 24, 2007 11:30 AM


Hi,

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.

if(true)
{
gridDataBoundGrid1.Binder.CancelEdit();
}


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

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.

;