Back to Devexpress

Layout Control

wpf-8147-controls-and-libraries-layout-management-tile-and-layout-layout-and-data-layout-controls-layout-control.md

latest6.5 KB
Original Source

Layout Control

  • Jul 08, 2025
  • 4 minutes to read

The LayoutControl is a container of items that arranges these items in a single row or column.

You can add LayoutGroup containers as children to the LayoutControl. A LayoutGroup container allows you to arrange its items side-by-side (either vertically or horizontally) or as tabs.

A LayoutGroup can contain other LayoutGroup objects as children, arranging their items in a different direction. This allows non-linear layouts to be created:

The greatest benefit of using the LayoutControl is that it automatically maintains a consistent layout of child controls. The controls do not overlap even, when the window is resized, controls are added or removed, or when the font settings of the controls are changed. (Controls may overlap if you manually adjust their Margin properties).

Besides the consistent layout functionality, the LayoutControl provides access to the following features:

LayoutControl’s Elements

The LayoutControl accepts items of any type. However, the following item types are the most common:

  • LayoutGroup. I– A container control that displays its children side-by-side (in a single row or column) or as tabs. You can use the LayoutGroup.View property to specify the LayoutGroup‘s visual style:

  • LayoutItem. –An object that displays a label for a control:

LayoutControl - Arranging items

Using LayoutGroups as children within a LayoutControl allows compound layouts to be implemented. Consider the following layout of items arranged within a LayoutControl:

To create the layout displayed above, items to be arranged in the same direction are combined into the same group. Then, these groups are combined into other groups, etc. To understand how this layout is built, let’s make the borders and headers of the groups visible:

Here, the items are combined as follows:

  • The LayoutControl arranges Group 1 and Group 5 vertically.
  • Group 1 arranges Group 2 and a tabbed group horizontally.
  • Group 2 arranges Item 1 and Group 3 vertically.
  • Group 3 arranges Item 2 and Group 4 horizontally.
  • Group 4 arranges two items vertically.
  • The tabbed group contains two tabs (Tab 1 and Tab 2). Each tab contains specific items. For instance, Tab 1, which is a LayoutGroup, arranges Item 5 and Item 6 vertically.
  • Group 5 arranges three items horizontally.

The complete XAML code for this example can be found at How to: Build a compound layout.

Smart Paste

You can apply a smart paste to the LayoutControl. Refer to the following help topic for more information: Smart Paste.

See Also

Layout Items and Groups

Aligning contents of LayoutItems

Aligning Items within LayoutGroup and LayoutControl Objects

Customization Mode

How to: Build Non-Linear Layout via LayoutControl