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
close icon

Formula Engine Recalculate

Hello,
I seem to be having an issue with the Grid formula engine. In resolution to an issue of recalculating formulas on deserialization (http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=40881) we run the following code after we deserialize the GridControl.

gm is the GridModel
Dim model As GridFormulaCellModel = gm.CellModels.Item("FormulaCell")
Dim engine As GridFormulaEngine = model.Engine
engine.FormulaCopyFlags = engine.FormulaCopyFlags Or GridFormulaCopyFlags.InsDelRangeReferencesUpdated Or GridFormulaCopyFlags.ClipBoardReferencesAdjusted
engine.RecalculateRange(GridRangeInfo.Table, True)
In calling ‘engine.RecalculateRange(GridRangeInfo.Table, True)’ our program enters an infinite loop on some grids with more complex formulas and other grids it seems to work fine. If we change the code to engine.RecalculateRange(GridRangeInfo.Table, True, True) the infinite loop seems to not occur. Is there is reason this happening? Can you shed some light on what the on what the force calculations and force parsing parameters are doing to ensure we are using them correctly and for better understanding it would be of great help.

Thank you so much.

Nick




1 Reply

FS Fathima Shalini P Syncfusion Team January 14, 2008 07:30 AM UTC

Hi Nick,

Thanks for your interest in Syncfusion Products.

When ForceCalculation is True, FormulaEngine will recalculate all the cells both the visible and non visible cells (locating out of visual range). But when it is false, it
will recalculate only the cells that are visible.

When forceParsing is False, a formula is only re-parsed if FormulaTag is NULL, or FormulaTag.Formula is empty. Otherwise, the existing parsed formula in FormulaTag.Formula is used to perform the calculation. The value of forceParsing only affects the Engine if forceCalculations is True.

Please let me know if any concerns.

Regards,
Fathima



Loader.
Live Chat Icon For mobile
Up arrow icon