Skip to main content

Aligning contents of LayoutItems

  • 2 minutes to read

 

#Across-Group Alignment

Layout items are objects that associate labels with controls. When layout items are used within a LayoutControl, the automatic alignment feature is enabled. With this feature, the left edges of the item's content regions are aligned according to the width of the largest label.

CD_AlignItems_AlignWithinGroup

By default, LayoutControl supports content region alignment across multiple groups. This takes place for layout items that have the same horizontal offset from the left edge of the LayoutControl, even if they belong to different groups. Again, content regions of these items are aligned by the largest label.

CD_AlignItems_AlignAcrossGroups2

The following image demonstrates the same feature. Here, layout groups are arranged in two columns. For layout items that have the same horizontal offset, content regions are aligned.

CD_AlignItems_AlignAcrossGroups_TwoColumns

#Local Alignment

For individual groups, you can enable a local alignment of items' content regions. The local alignment of content regions is not affected by labels of other groups. To enable the local alignment of content regions, set the LayoutGroup.ItemLabelsAlignment property to Local.

In the following image, the LayoutGroup.ItemLabelsAlignment property is set to Local for Group 2. The content regions in this group are aligned locally, while the content regions in Group 1, Group 3 and Group 4 are aligned disregarding the labels in Group 2.

CD_AlignItems_AlignAcrossGroups_GroupAlignScope