Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

DocumentOptions.CalculationMode Property

Gets or sets the calculation mode that specifies when to calculate formulas in a Workbook or Spreadsheet control.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v21.2.Core.dll

Declaration

[Browsable(false)]
public WorkbookCalculationMode CalculationMode { get; set; }

Property Value

Type Description
WorkbookCalculationMode

An enumeration member that specifies the calculation mode. The default is UseDocumentSettings for the WinForms and WPF Spreadsheet, and Manual for a Workbook component.

Property Paths

You can access this nested property as listed below:

Object Type Path to CalculationMode
ISpreadsheetComponent
.Options .CalculationMode

Remarks

The CalculationMode property allows you to override the calculation mode of the loaded document (this setting is stored in the IWorkbook.DocumentSettings.Calculation.Mode property).

For instance, use Automatic mode for the Spreadsheet control if it should recalculate all dependent formulas every time a value, formula, or name referenced in these formulas changes.

spreadsheetControl1.Options.CalculationMode = WorkbookCalculationMode.Automatic;

Use Manual mode for a non-visual Workbook to improve document generation speed for large workbooks with multiple formulas. Call the Workbook.Calculate, Worksheet.Calculate, or CellRange.Calculate method to calculate formulas in the document.

using (Workbook workbook = new Workbook())
{
    // Disable automatic calculations.
    workbook.Options.CalculationMode = WorkbookCalculationMode.Manual;
    // ...
    // Generate the document content.
    // ...
    // Perform calculations if needed.
    workbook.Calculate();
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CalculationMode property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also