Skip to main content

TdxLayoutContainer.EndUpdate(Boolean) Method

Enables refresh operations on the layout control, and invalidates the control.

Declaration

procedure EndUpdate(ANeedPack: Boolean = True);

Parameters

Name Type
ANeedPack Boolean

Remarks

The BeginUpdate and EndUpdate (CancelUpdate) methods work together to prevent numerous updates of the layout control when adding groups or items. Make certain to call the EndUpdate (CancelUpdate) method after calling BeginUpdate. Every call of the BeginUpdate method increases the internal counter by one. Every call of the EndUpdate (CancelUpdate) method decreases the internal counter by one. The layout control refreshes itself only when the internal counter is 0.

Since the execution of updates can exit with either a normal or exception state, these updates and the EndUpdate method should be contained within try… finally… blocks following the BeginUpdate method, to ensure that View updates will be enabled in all cases.

To enable View updates without the control invalidation, use the CancelUpdate method.

ANeedPack specifies whether redundant child groups within the current group will be removed, and their contents will be moved to their immediate parent groups using the Pack method call. Set ANeedPack to True, to remove redundant child groups.

See Also