FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : AutoCalculation Property |
'Declaration Public Property AutoCalculation As Boolean
'Usage Dim instance As SheetView Dim value As Boolean instance.AutoCalculation = value value = instance.AutoCalculation
public bool AutoCalculation {get; set;}
When this property is set to true, the Spread component automatically recalculates each formula when the contents of cells referenced by the formula change. When this property is set to false, cells with formulas are not updated when data changes.
If you have set this property to false, you can use the Recalculate method to force a recalculation of the formulas that have changed or the RecalculateAll method to force a recalculation of all formulas.
Define formulas using the Cell.Formula property, Row.Formula property, or Column.Formula property.
For more information about formulas, refer to the Formula Reference.
DialogResult dlg; fpSpread1.ActiveSheet.SetValue(0, 0, 10); fpSpread1.ActiveSheet.SetValue(0, 1, 20); fpSpread1.ActiveSheet.SetFormula(3, 0, "SUM(A1,B1)"); dlg = MessageBox.Show("Do you want to recalculate the formula?", "AutoCalculation", MessageBoxButtons.YesNo); if (dlg == DialogResult.Yes) { fpSpread1.ActiveSheet.AutoCalculation = true; fpSpread1.ActiveSheet.SetValue(0, 1, 50); } else if(dlg == DialogResult.No) { fpSpread1.ActiveSheet.AutoCalculation = false; fpSpread1.ActiveSheet.SetValue(0, 1, 50); }
Dim dlg As DialogResult FpSpread1.ActiveSheet.SetValue(0, 0, 10) FpSpread1.ActiveSheet.SetValue(0, 1, 20) FpSpread1.ActiveSheet.SetFormula(3, 0, "SUM(A1,B1)") dlg = MessageBox.Show("Do you want to recalculate the formula?", "AutoCalculation", MessageBoxButtons.YesNo) If dlg = DialogResult.Yes Then FpSpread1.ActiveSheet.AutoCalculation = True FpSpread1.ActiveSheet.SetValue(0, 1, 50) ElseIf dlg = DialogResult.No Then FpSpread1.ActiveSheet.AutoCalculation = False FpSpread1.ActiveSheet.SetValue(0, 1, 50) End If
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8