Back to Devexpress

PivotTable.BeginUpdate() Method

officefileapi-devexpress-dot-spreadsheet-dot-pivottable-f02c4bb2.md

latest1.8 KB
Original Source

PivotTable.BeginUpdate() Method

Locks the PivotTable object. Prevents visual updates until the EndUpdate method calls.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void BeginUpdate()
vb
Sub BeginUpdate

Remarks

Use the BeginUpdate and EndUpdate methods to avoid flickering during batch modifications to the PivotTable‘s settings. After calling BeginUpdate, any changes to the PivotTable‘s settings do not cause immediate repainting. This allows multiple changes without affecting performance or causing screen flickering. Once you finish all desired changes, call EndUpdate.

The BeginUpdate and EndUpdate methods use an internal counter to manage updates. The counter starts at 0. When the counter is above 0, the system blocks visual updates. When the counter returns to 0, the system allows updates. The BeginUpdate method increments the counter. The EndUpdate method decrements the counter. If the counter reaches 0, an immediate visual update occurs.

Always pair each BeginUpdate call with an EndUpdate call. To ensure EndUpdate runs even if an exception occurs, use the try...finally statement.

See Also

EndUpdate()

PivotTable Interface

PivotTable Members

DevExpress.Spreadsheet Namespace