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

Thread ID:

Created:

Updated:

Platform:

Replies:

18005 Aug 21,2004 05:49 PM Aug 22,2004 02:04 AM Windows Forms 1
loading
Tags: GridControl
Lori S. Pearsall
Asked On August 21, 2004 05:49 PM

I have some columns in a grid that I need to trap changes to so that I can refresh a diagram in another window. I''ve got this working by putting the logic in CurrentCellAcceptedChanges. However, I''m not able to trap any changes to these cells as a result of an Undo/Redo operation. 1) What is the best way to determine whether an Undo/Redo operation changed the contents of a cell and, if so, which column? 2) Some of the columns in question are custom with their own CellRenderer classes. How would I, on a column basis, specify that changes to the column should NOT be recorded on the Undo stack? Thanks!

Administrator [Syncfusion]
Replied On August 22, 2004 02:04 AM

1) Instead of CurrentCellAcceptedChanges, you might move your code to grid.Model.SaveCellInfo. This should be hit whether the change comes from the user or whether it is from a undo/redo. (If you need the value of the cell, get it from e.Style.CellValue.) 2) In grid.CurrentCellMoved, you can try turning off/on the commandstack when you are in a column that you do not want to support undo. Here is a try at turning it off for column 2.
private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
{
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(cc.MoveFromColIndex == 2 && cc.MoveToColIndex != 2)
		this.gridDataBoundGrid1.Model.CommandStack.Enabled = true;
	else if(cc.MoveFromColIndex != 2 && cc.MoveToColIndex == 2)
		this.gridDataBoundGrid1.Model.CommandStack.Enabled = false;
}

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.

;