Spread Windows Forms 6.0 Product Documentation
AutoCalculation Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class : AutoCalculation Property


Glossary Item Box

Gets or sets whether the control automatically recalculates each formula in the sheet when the contents of dependent cells change.

Syntax

Visual Basic (Declaration) 
Public Property AutoCalculation As Boolean
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim value As Boolean
 
instance.AutoCalculation = value
 
value = instance.AutoCalculation
C# 
public bool AutoCalculation {get; set;}

Property Value

Boolean: true to automatically recalculate formulas; false otherwise

Example

Visual BasicCopy Code
Dim dataModel As New FarPoint.Win.Spread.Model.DefaultSheetDataModel(5, 5)
Dim dlg As DialogResult
FpSpread1.ActiveSheet.Models.Data = dataModel
dataModel.SetValue(0, 0, 10)
dataModel.SetValue(1, 0, 20)
dataModel.SetFormula(1, 1, "3*SUM(A1, A2)")
dlg = MessageBox.Show("Do you want to AutoCalculate the formula??", "AutoCalculation", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
dataModel.SetValue(1, 0, 80)
dataModel.AutoCalculation = True
End If
C#Copy Code
FarPoint.Win.Spread.Model.DefaultSheetDataModel dataModel = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(5, 5);
DialogResult dlg;
fpSpread1.ActiveSheet.Models.Data = dataModel;
dataModel.SetValue(0, 0, 10);
dataModel.SetValue(1, 0, 20);
dataModel.SetFormula(1, 1, "3*SUM(A1, A2)");
dlg = MessageBox.Show("Do you want to AutoCalculate the formula??", "AutoCalculation", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
dataModel.SetValue(1, 0, 80);
dataModel.AutoCalculation = true;
}

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.