Skip to main content

TcxLockablePersistent.CancelUpdate Method

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

Declaration

procedure CancelUpdate;

Remarks

Every time you modify settings or change displayed content, the parent object (a component, control, or visual element) redraws itself to reflect the change. Enclose multiple content and appearance 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 component’s appearance. It only re-enables change notifications and the corresponding redraw operations. The component 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. Otherwise, the component remains frozen and unresponsive.

CancelUpdate Usage Scenarios

The CancelUpdate procedure is designed for the rare usage scenarios when you need to configure a component 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 component 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