Spread WPF 18
Features / Formulas and Functions / Auto-Recalculation and Updates
In This Topic
    Auto-Recalculation and Updates
    In This Topic

    Spread for WPF supports automatic recalculation and auto-update of formulas in worksheets.

    Formulas are automatically recalculated and updated under the following conditions:

    The Calculation enumeration controls how the spreadsheet engine calculates formulas in the worksheet. The value of this enumeration can be set to one of the three modes: Manual, Automatic, or Semiautomatic.

    When the Calculation Enum is set to Automatic, the following rules apply:

    Note: When automatic formula updates are not required, the Calculation Enum can be set to Manual mode. In this case, even if dependent cells change, formulas will not be automatically updated.

    The following GIFs illustrate the Automatic and Manual calculation modes in the worksheet, showcasing the results when the values of dependent cells are updated.

    Automatic Mode:

    Manual Mode:

    Refer to the following example code to set the automatic mode to perform formula calculations.

    Copy Code
    // Set the calculation mode to “Automatic”.
    spreadSheet1.Workbook.WorkbookSet.CalculationEngine.Calculation = GrapeCity.Spreadsheet.Calculation.Automatic;
    
    Copy Code
    ' Set the calculation mode to “Automatic”.
    spreadSheet1.Workbook.WorkbookSet.CalculationEngine.Calculation = GrapeCity.Spreadsheet.Calculation.Automatic