# Layout Items and Groups | WPF Controls | DevExpress Documentation

Layout items and groups are base elements for both [Layout Control](/WPF/8147/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/layout-control) and [Data Layout Control](/WPF/11540/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/data-layout-control).

## Layout Items

A [LayoutItem](/WPF/DevExpress.Xpf.LayoutControl.LayoutItem) ([DataLayoutItem](/WPF/DevExpress.Xpf.LayoutControl.DataLayoutItem)) object is a control that provides label and content regions. The control region can display any UIElement object.

![LayoutItem](/WPF/images/layoutitem11641.png)

You can use LayoutItems within a [LayoutControl](/WPF/DevExpress.Xpf.LayoutControl.LayoutControl) to display a label next to a control. For [Data Layout Control](/WPF/11540/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/data-layout-control), use [DataLayoutItem](/WPF/DevExpress.Xpf.LayoutControl.DataLayoutItem) instead.

![CD_LayoutItems](/WPF/images/cd_layoutitems11642.png)

- XAML

<section id="tabpanel_snPn9bPhFw_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;Window ...
        xmlns:dxe=&quot;http://schemas.devexpress.com/winfx/2008/xaml/editors&quot;
        xmlns:dx=&quot;http://schemas.devexpress.com/winfx/2008/xaml/core&quot;
        xmlns:dxl=&quot;http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol&quot;
        ...&gt;
    &lt;Window.Resources&gt;
        &lt;Style x:Key=&quot;customCornerStyle&quot; TargetType=&quot;dxl:GroupBox&quot;&gt;
            &lt;Setter Property=&quot;CornerRadius&quot; Value=&quot;10&quot;/&gt;
            &lt;Setter Property=&quot;Background&quot; Value=&quot;White&quot;/&gt;
        &lt;/Style&gt;
    &lt;/Window.Resources&gt;
    &lt;dxl:LayoutControl&gt;
        &lt;dxl:LayoutGroup View=&quot;GroupBox&quot; Orientation=&quot;Vertical&quot;
                         Header=&quot;Address info&quot; GroupBoxStyle=&quot;{StaticResource customCornerStyle}&quot;&gt;

            &lt;dxl:LayoutGroup Orientation=&quot;Horizontal&quot;&gt;
                &lt;dxl:LayoutItem Label=&quot;Country&quot; AddColonToLabel=&quot;True&quot;&gt;
                    &lt;dxe:TextEdit EditValue=&quot;USA&quot;/&gt;
                &lt;/dxl:LayoutItem&gt;
                &lt;dxl:LayoutItem Label=&quot;Region&quot; AddColonToLabel=&quot;True&quot;&gt;
                    &lt;dxe:TextEdit EditValue=&quot;WA&quot;/&gt;
                &lt;/dxl:LayoutItem&gt;
            &lt;/dxl:LayoutGroup&gt;

            &lt;dxl:LayoutGroup Orientation=&quot;Horizontal&quot;&gt;
                &lt;dxl:LayoutItem Label=&quot;City&quot; AddColonToLabel=&quot;True&quot;&gt;
                    &lt;dxe:TextEdit EditValue=&quot;Seattle&quot;/&gt;
                &lt;/dxl:LayoutItem&gt;
                &lt;dxl:LayoutItem Label=&quot;Postal code&quot; AddColonToLabel=&quot;True&quot;&gt;
                    &lt;dxe:TextEdit EditValue=&quot;98122&quot;/&gt;
                &lt;/dxl:LayoutItem&gt;
            &lt;/dxl:LayoutGroup&gt;

            &lt;dxl:LayoutGroup Orientation=&quot;Horizontal&quot;&gt;
                &lt;dxl:LayoutItem Label=&quot;Address&quot; AddColonToLabel=&quot;True&quot;&gt;
                    &lt;dxe:TextEdit EditValue=&quot;507 - 20th Ave.E. Apt.2A&quot;/&gt;
                &lt;/dxl:LayoutItem&gt;
            &lt;/dxl:LayoutGroup&gt;

            &lt;dxl:LayoutGroup Orientation=&quot;Horizontal&quot;&gt;
                &lt;dxl:LayoutItem Label=&quot;Home phone&quot; AddColonToLabel=&quot;True&quot;&gt;
                    &lt;dxe:TextEdit EditValue=&quot;2065559857&quot; MaskType=&quot;Simple&quot; 
                                  Mask=&quot;(000) 000-0000&quot; MaskUseAsDisplayFormat=&quot;True&quot;/&gt;
                &lt;/dxl:LayoutItem&gt;
                &lt;dxl:LayoutItem Label=&quot;Postal code&quot; AddColonToLabel=&quot;True&quot;&gt;
                    &lt;dxe:TextEdit EditValue=&quot;5467&quot;/&gt;
                &lt;/dxl:LayoutItem&gt;
            &lt;/dxl:LayoutGroup&gt;

        &lt;/dxl:LayoutGroup&gt;
    &lt;/dxl:LayoutControl&gt;
&lt;/Window&gt;
</code></pre></section>

The LayoutControl supports automatic alignment for its child LayoutItem objects. The left edges of item content regions are automatically aligned within groups, and even across multiple groups. See [Aligning contents of LayoutItems](/WPF/8152/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/aligning-contents-of-layoutitems) to learn more.

To provide a label for a LayoutItem, use the [LayoutItem.Label](/WPF/DevExpress.Xpf.LayoutControl.LayoutItem.Label) property. The [LayoutItem.LabelTemplate](/WPF/DevExpress.Xpf.LayoutControl.LayoutItem.LabelTemplate) allows you to specify a DataTemplate used to render the label. The label’s style can be customized via the [LayoutItem.LabelStyle](/WPF/DevExpress.Xpf.LayoutControl.LayoutItem.LabelStyle) property.

You can display the label at the top of the item’s content region. To change the position, see the [LayoutItem.LabelPosition](/WPF/DevExpress.Xpf.LayoutControl.LayoutItem.LabelPosition) property.

A layout item’s content can be specified via the [LayoutItem.Content](/WPF/DevExpress.Xpf.LayoutControl.LayoutItem.Content) property. To specify item content in XAML, define the object between the LayoutItem’s start and end tags.

## See Also

- [Layout Control](/WPF/8147/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/layout-control)
- [Aligning contents of LayoutItems](/WPF/8152/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/aligning-contents-of-layoutitems)
- [How to: Build a compound layout](/WPF/8358/controls-and-libraries/layout-management/tile-and-layout/examples/how-to-build-a-compound-layout)
- [How to: Build Non-Linear Layout via LayoutControl](/WPF/8360/controls-and-libraries/layout-management/tile-and-layout/examples/how-to-build-non-linear-layout-via-layoutcontrol)

## Layout Groups

A [LayoutGroup](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup) is a container that arranges its items ([LayoutItem](/WPF/DevExpress.Xpf.LayoutControl.LayoutItem) and [DataLayoutItem](/WPF/DevExpress.Xpf.LayoutControl.DataLayoutItem) objects or other layout groups) in the specific manner. The LayoutGroup cannot be used outside a [LayoutControl](/WPF/DevExpress.Xpf.LayoutControl.LayoutControl) or [DataLayoutControl](/WPF/DevExpress.Xpf.LayoutControl.DataLayoutControl).

The [LayoutGroup.View](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.View) property specifies how the group’s items are displayed - side-by-side or as tabs.

If the property is set to [LayoutGroupView.Group](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroupView) or [LayoutGroupView.GroupBox](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroupView), the group’s items are arranged in a single row or column, according to the [LayoutGroup.Orientation](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.Orientation) property. The alignment of an item within a group can be adjusted via the item’s **HorizontalAlignment** and **VerticalAlignment** properties.

In default display mode ([LayoutGroupView.Group](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroupView)), a group doesn’t display its header. To enable the header, set the [LayoutGroup.View](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.View) property to [LayoutGroupView.GroupBox](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroupView). To specify the object to display in the group’s header use the [LayoutGroup.Header](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.Header) property.

A LayoutGroup supports the collapsing feature in the [LayoutGroupView.GroupBox](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroupView) paint style. You can enable the collapsing feature by setting the [LayoutGroup.IsCollapsible](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.IsCollapsible) property. In this mode, the group displays the collapse/expand button, allowing an end-user to collapse/restore the group’s contents. To specify the expansion state in code, see [LayoutGroup.IsCollapsed](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.IsCollapsed).

The following code creates a LayoutGroup with two items. The collapsing feature is enabled via the [LayoutGroup.IsCollapsible](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.IsCollapsible) option:

- XAML

<section id="tabpanel_snPn9bPhFw-1_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;lc:LayoutGroup Orientation=&quot;Vertical&quot; View=&quot;GroupBox&quot; Header=&quot;Layout Group&quot; 
                Width=&quot;150&quot; IsCollapsible=&quot;True&quot;&gt;
    &lt;lc:LayoutItem Label=&quot;Item 1&quot;&gt;
        &lt;TextBox   Text=&quot;&quot;/&gt;
    &lt;/lc:LayoutItem&gt;
    &lt;lc:LayoutItem Label=&quot;Item 2&quot;&gt;
        &lt;TextBox   Text=&quot;&quot;/&gt;
    &lt;/lc:LayoutItem&gt;
&lt;/lc:LayoutGroup&gt;
</code></pre></section>

The result is shown below:

![LayoutGroup1](/WPF/images/layoutgroup111812.png)

To enable the tabbed UI for a LayoutGroup, set [LayoutGroup.View](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.View) to [LayoutGroupView.Tabs](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroupView). Each child will be represented as a tab.

If another LayoutGroup object is a child of a tabbed group, the corresponding tab header displays the LayoutGroup’s [LayoutGroup.Header](/WPF/DevExpress.Xpf.LayoutControl.LayoutGroup.Header) object. For other layout items, you can specify tab headers via the [LayoutControl.TabHeader](/WPF/DevExpress.Xpf.LayoutControl.LayoutControl.TabHeader) attached property.

The following code creates a tabbed LayoutGroup:

- XAML

<section id="tabpanel_snPn9bPhFw-2_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;lc:LayoutControl x:Name=&quot;layoutControl1&quot; Background=&quot;#FFEAEAEA&quot;&gt;
    &lt;lc:LayoutGroup View=&quot;Tabs&quot; Width=&quot;200&quot; &gt;
        &lt;lc:LayoutGroup Orientation=&quot;Vertical&quot; Header=&quot;Tab 1&quot;&gt;
            &lt;lc:LayoutItem Label=&quot;Item A&quot;&gt;
                &lt;TextBox   Text=&quot;&quot;/&gt;
            &lt;/lc:LayoutItem&gt;
            &lt;lc:LayoutItem Label=&quot;Item B&quot;&gt;
                &lt;TextBox   Text=&quot;&quot;/&gt;
            &lt;/lc:LayoutItem&gt;
        &lt;/lc:LayoutGroup&gt;
        &lt;lc:LayoutItem Label=&quot;Item 2&quot; lc:LayoutControl.TabHeader=&quot;Tabbed Item&quot;&gt;
            &lt;TextBox   Text=&quot;&quot;/&gt;
        &lt;/lc:LayoutItem&gt;
    &lt;/lc:LayoutGroup&gt;
&lt;/lc:LayoutControl&gt;
</code></pre></section>

The result is shown below:

![LayoutGroup1_Tabbed](/WPF/images/layoutgroup1_tabbed11813.png)

The most common scenario for using a LayoutGroup is in a [LayoutControl](/WPF/DevExpress.Xpf.LayoutControl.LayoutControl). Using LayoutGroups, you can build compound layouts, as demonstrated in the [Layout Control](/WPF/8147/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/layout-control) topic.

## See Also

- [Aligning Items within LayoutGroup and LayoutControl Objects](/WPF/8153/controls-and-libraries/layout-management/tile-and-layout/layout-and-data-layout-controls/aligning-items-within-layoutgroup-and-layoutcontrol-objects)
- [How to: Build a compound layout](/WPF/8358/controls-and-libraries/layout-management/tile-and-layout/examples/how-to-build-a-compound-layout)
- [How to: Build Non-Linear Layout via LayoutControl](/WPF/8360/controls-and-libraries/layout-management/tile-and-layout/examples/how-to-build-non-linear-layout-via-layoutcontrol)
- [How to: Customize style of LayoutGroup’s header](/WPF/8361/controls-and-libraries/layout-management/tile-and-layout/examples/how-to-customize-style-of-layoutgroups-header)