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.v19.1.Core.dll
Declaration
Property Value
Type | Description |
---|---|
WorkbookCalculationMode | An enumeration member that specifies the calculation mode. The default is UseDocumentSettings. |
Property Paths
You can access this nested property as listed below:
Library | Object Type | Path to CalculationMode |
---|---|---|
WinForms Controls | SpreadsheetControl |
|
Office File API | ISpreadsheetComponent |
|
Workbook |
|
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.
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 Range.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();
}