Skip to main content

Hidden Group

  • 2 minutes to read

A hidden layout group (hidden group for short) is an auxiliary layout group designed to help a layout group maintain the arrangement direction of its immediate child elements. Generally, there is no need to manually create or remove hidden groups, because the ExpressLayout Control manages them on the fly when required (see the example below).

For instance, assume there is a user-defined group (Group1) with three items (Item1, Item2, and Item3). These items are arranged horizontally within the group (the LayoutDirection property of the group is set to ldHorizontal).

Then an end-user wants to rearrange the group. Assume an end-user moves one of the items (Item3) under a specific item (Item1).

In order to keep the horizontal layout direction within the group (Group1), the ExpressLayout Control automatically creates a new hidden group (a TdxLayoutAutoCreatedGroup object) for Item1 and Item3.

Thus, this hidden group contains two items (Item1 and Item3) and the layout direction within the hidden group is vertical. Now Group1 contains only two elements: the hidden group and Item2. And the Group1 layout direction is not changed (ldHorizontal).

When an end-user moves Item1 or Item3 from the hidden group, the ExpressLayout Control considers this hidden group redundant (i.e., no longer required to maintain the vertical layout direction for one item) and automatically removes the group.

In comparison with a user-defined group, a hidden group has the following limitations:

  • A hidden group cannot have borders and captions – its ShowBorder property is set to False, while the CaptionOptions.Visible property has no effect;

  • Any hidden group can be automatically removed by the Pack method if this group is redundant. Refer to the method description to learn more.

Note

A group is considered hidden if its Hidden property is set to True. In automatically created hidden groups (TdxLayoutAutoCreatedGroup objects), this property is initialized to True. We do not recommend that you manually switch the property value to allow the ExpressLayout Control to properly remove redundant hidden groups in all cases.

See Also