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

Formula cell undo/redo in GridControl

I''ve asked previously about undo/redo support for FormulaCells in a GridControl. Clay indicated that I would have to write custom commands, but now I''m not so sure. Background: my grid is about 700x75, with probably 60 SUMIF formulas in each column. Some formulas rely on the results of other formula cells. I see by reviewing the undo stack that changing one numeric value triggers about 5-6 undo commands as the other formulas recalculate. So, it seems that the GridControl does support undo for FormulaCells. The problem is that those undo commands were not wrapped in a transaction, so I have to undo 5-6 times when the same situation in Excel would require 1 undo. I''ve been trying to figure out if there is some way to create a transaction around the user-initiated change and the automatic changes. However, there is no flag that indicates whether user input or code triggered the change. Another thing that I need to handle soon is somewhat related. If a user changes a cell value, I need to programatically change other cells to maintain a certain relationship. Those should also be grouped into one undo. The idea is similar to Excel Goal Seek. To make matters worse, is firing SaveCellInfo at LEAST twice for every change. I''m pretty sure I''ve recorded six hits for one change to a FormulaCell. What can I do? Thanks! Tom

1 Reply

AD Administrator Syncfusion Team June 2, 2005 07:44 PM UTC

The SaveCellInfo being raised twice is logged in this defect. http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=284 As far as setting up transactions, maybe try handling CurrentCellMoved. This is just a rough idea. It may take some additional events to handle all possibilities. The idea would if there is a transaction recorded, then commit it, and begin a new one. This way anything that happen as the user was typing in a cell would essentially be one transaction. You may have to handle special cases like teh user clicking off teh grid and not really hitting CurrentCellMoved. But just handling CurrentcellMoved and testing if things work ok there would probably not take that much time to see it this will be feaseable. If so, then you could spend the additional time handling the more special situations.

Live Chat Icon For mobile
Up arrow icon