Skip to main content

TdxCustomSpreadSheet.CancelUpdate Method

Re-enables change notifications and delays pending changes made in the spreadsheet control after a BeginUpdate procedure call until the next content or setting change.

Declaration

procedure CancelUpdate;

Remarks

Every time you change the current spreadsheet document or any control settings, the control redraws its UI and content to reflect the change. Enclose multiple content and setting changes between BeginUpdate and EndUpdate procedure calls to avoid UI flickering due to excessive redraw operations and improve performance.

BeginUpdate/CancelUpdate and Batch Changes

A BeginUpdate procedure call disables notifications and postpones all changes until an EndUpdate call. Unlike EndUpdate, the CancelUpdate procedure does not apply pending changes to the control’s appearance. CancelUpdate only re-enables change notifications and corresponding redraw operations. The control applies pending changes made between BeginUpdate and CancelUpdate calls with the next content or appearance change.

Note

Ensure that every BeginUpdate procedure call is followed by an EndUpdate or CancelUpdate procedure call, even if an exception occurs.

CancelUpdate Usage Scenarios

The CancelUpdate procedure is designed for the rare usage scenarios when you need to configure the Spreadsheet or Report Designer control while it is invisible. The EndUpdate procedure forces massive recalculations in the UI thread that may take a noticeable amount of time and render the application UI temporarily unresponsive.

If the control is invisible during this process, you may want to re-enable change notifications and delay the time-consuming apply changes operation until the next change made after a CancelUpdate procedure call.

See Also