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

SaveCellInfo not called

Version 4.4.0.46

I have two grids, Equipment and Telephones. Formulas in Telephones reference values in Equipment.

In grid Telephones, I have a cell with formula =SUM(Equipment!SmallPhones.EquipmentAnnualRevenue) that is not calling SaveCellInfo when a value is changed in the Equipment grid. The formula is evaluated because the value changes in its cell, it is just that SaveCellInfo is not called for this cell.

What is odd is that when other formulas in the Telephone grid are evaluated (during the same operation), SaveCellInfo is called for those cells.

Why would SaveCellInfo not be call when a formula is evaluated/the value changes?

SaveCellInfo is the only event I am handling.

Thanks,

Jerry


5 Replies

HA haneefm Syncfusion Team July 17, 2007 05:40 PM UTC

Hi Jeffery,

When using the formula engine with a grid, there are situations where SaveCellInfo may not be called (even though the engine does update the cell properly). This may happen when some formulas are not visible, or may depend upon the order of the appearance of the formulas in the grid and is due to internal painting optimizations within GridControlBase. To force the calling of SaveCellInfo in these situations , you can set this property in Form.Load:

[c#]
GridFormulaEngine engine = ((GridFormulaCellModel)gridControl1.Model.CellModels["FormulaCell"]).Engine;
engine.ForceSaveCellInfo = true;

Best regards,
Haneef


HA haneefm Syncfusion Team July 17, 2007 05:42 PM UTC

Hi Jerry,

My apologies for addressing to the wrong person, it was meant for you.

When using the formula engine with a grid, there are situations where SaveCellInfo may not be called (even though the engine does update the cell properly). This may happen when some formulas are not visible, or may depend upon the order of the appearance of the formulas in the grid and is due to internal painting optimizations within GridControlBase. To force the calling of SaveCellInfo in these situations , you can set this property in Form.Load:

[c#]
GridFormulaEngine engine = ((GridFormulaCellModel)gridControl1.Model.CellModels["FormulaCell"]).Engine;
engine.ForceSaveCellInfo = true;

Best regards,
Haneef


JL Jerry Lawrence July 17, 2007 06:49 PM UTC

I am currently calling ForceSaveCellInfo. Here is the code. Note the ForceSaveCellInfo = true toward the end.

int sheetFamilyID = GridFormulaEngine.CreateSheetFamilyID();
GridFormulaEngine.RegisterGridAsSheet("Analysis", _gridAnalysis.Model, sheetFamilyID);
GridFormulaEngine.RegisterGridAsSheet("Workflow", _gridWorkflow.Model, sheetFamilyID);
GridFormulaEngine.RegisterGridAsSheet("MiscRevenue", _gridMiscellaneousRevenue.Model, sheetFamilyID);
GridFormulaEngine.RegisterGridAsSheet("Equipment", _gridEquipment.Model, sheetFamilyID);
GridFormulaEngine.RegisterGridAsSheet("LocalService", _gridLocalService.Model, sheetFamilyID);
GridFormulaEngine.RegisterGridAsSheet("Telephones", _gridTelephones.Model, sheetFamilyID);
GridFormulaEngine.RegisterGridAsSheet("Installation", _gridInstallation.Model, sheetFamilyID);
GridFormulaEngine.RegisterGridAsSheet("Data", _gridData.Model, sheetFamilyID);

_gridAnalysis.TableStyle.CellType = "FormulaCell";
_gridWorkflow.TableStyle.CellType = "FormulaCell";
_gridMiscellaneousRevenue.TableStyle.CellType = "FormulaCell";
_gridEquipment.TableStyle.CellType = "FormulaCell";
_gridLocalService.TableStyle.CellType = "FormulaCell";
_gridTelephones.TableStyle.CellType = "FormulaCell";
_gridInstallation.TableStyle.CellType = "FormulaCell";
_gridData.TableStyle.CellType = "FormulaCell";
_engine = ((GridFormulaCellModel)_gridAnalysis.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;


AD Administrator Syncfusion Team July 17, 2007 08:19 PM UTC

Try setting that property on all your formula engines. The RegisterGridAsSheet just sets up all the engines to share the same data stores, but there are still distinct engine instances for each grid.

_engine = ((GridFormulaCellModel)_gridAnalysis.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;

_engine = ((GridFormulaCellModel)_gridWorkflow.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;

_engine = ((GridFormulaCellModel)_gridMiscellaneousRevenue.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;

_engine = ((GridFormulaCellModel)_gridEquipment.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;

_engine = ((GridFormulaCellModel)_gridLocalService.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;

_engine = ((GridFormulaCellModel)_gridTelephones.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;

_engine = ((GridFormulaCellModel)_gridInstallation.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;

_engine = ((GridFormulaCellModel)_gridData.Model.CellModels["FormulaCell"]).Engine;
_engine.ForceSaveCellInfo = true;


JL Jerry Lawrence July 17, 2007 09:20 PM UTC

That worked. Thanks!

Loader.
Live Chat Icon For mobile
Up arrow icon