.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
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.v20.1.Core.dll

Declaration

[Browsable(false)]
public WorkbookCalculationMode CalculationMode { get; set; }
<Browsable(False)>
Public Property CalculationMode As WorkbookCalculationMode

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:

Library Object Type Path to CalculationMode
WinForms Controls SpreadsheetControl
.Options.CalculationMode
Office File API ISpreadsheetComponent
.Options.CalculationMode
Workbook
.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();
}
See Also