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.

GDBG undo/redo problem

Thread ID:

Created:

Updated:

Platform:

Replies:

29292 May 22,2005 01:47 PM May 22,2005 05:48 PM Windows Forms 1
loading
Tags: GridControl
Bob Wis
Asked On May 22, 2005 01:47 PM

We are currently using the GridDataBoundGrid with the Undo/Redo feature. The Undo/Redo only seems to work on every other change. Here are the steps: 1) User makes change to cell 1,1 and hits tab 2) User makes change to cell and hits tab 3) repeat several times 4) hit ctrl-z to undo everything 5) every other change does not get undone. It appears that the undo is not always committed. Has anyone encountered this before? Bob

Administrator [Syncfusion]
Replied On May 22, 2005 05:48 PM

Every other undo is probably undoing a selection command which does not really show up in the UI. Try this. First, set this.gridDataBoundGrid1.Binder.DirectSaveCellInfo = true; to avoid problem of the grid caching changes until you leave the row. If you want to transparently process the selection commands so your user sees a change with each ctlZ, in the undo menu handler (which has a ctlZ hotkey), use code like:
private void menuItem2_Click(object sender, System.EventArgs e)
{
	if(this.gridDataBoundGrid1.Model.CommandStack.UndoStack.Count > 0)
		this.gridDataBoundGrid1.Model.CommandStack.Undo();

	object o = null;
	if(this.gridDataBoundGrid1.Model.CommandStack.UndoStack.Count > 0)
		o = this.gridDataBoundGrid1.Model.CommandStack.UndoStack.Peek();
	while(o is GridSelectionStateCommand)
	{
		this.gridDataBoundGrid1.Model.CommandStack.Undo();
		if(this.gridDataBoundGrid1.Model.CommandStack.UndoStack.Count > 0)
			o = this.gridDataBoundGrid1.Model.CommandStack.UndoStack.Peek();
		else
			o = null;
	}
}

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.

;