Skip to main content

LayoutGroup.ItemStyle Property

Gets or sets the style of layout items that belong to the current group and nested groups (provided that the nested group’s ItemStyle property is not set). This is a dependency property.

Namespace: DevExpress.Xpf.LayoutControl

Assembly: DevExpress.Xpf.LayoutControl.v22.1.dll


public Style ItemStyle { get; set; }

Property Value

Type Description

A Style object that represents the style of layout items.



This style is intended for the LayoutItem type.

See the Styling and Templating topic in MSDN to learn more.


The following code shows how to change the styles of labels for individual layout items, or all of them. The style is changed via the LayoutItem.LabelStyle property. Styles of layout items’ labels can be customized via the LayoutItem.LabelStyle property. This example demonstrates two approaches to changing the LabelStyle property:

  • for all layout items belonging to a container - via the container’s LayoutGroup.ItemStyle property. In this example, this style specifies the blue foreground color for labels
  • for individual layout items - directly via their LayoutItem.LabelStyle properties. In the example, this style, applied to the first layout item (Model), paints the item’s label in red.

The following image shows the result:


View Example

    Title="MainWindow" Height="350" Width="525">

        <!--The default style for layout items: labels are painted in blue-->
        <Style x:Key="DefaultLayoutItemStyle" TargetType="lc:LayoutItem">
            <Setter Property="LabelStyle">
                    <Style TargetType="lc:LayoutItemLabel">
                        <Setter Property="Foreground" Value="#FF0000FF" />
            <Setter Property="ElementSpace" Value="8" />
        <!--A custom style to paint labels in red-->
        <Style x:Key="MyLabelStyle" TargetType="lc:LayoutItemLabel">
            <Setter Property="Foreground" Value="#FFFF0000" />

    <!--Apply the default style to layout items-->
    <lc:LayoutControl x:Name="LayoutRoot" ItemStyle="{StaticResource DefaultLayoutItemStyle}">

        <!--Apply the custom style to the first layout item-->
        <lc:LayoutGroup Header="Group 1" View="GroupBox" Orientation="Vertical">
            <lc:LayoutItem Label="Model:" LabelStyle="{StaticResource MyLabelStyle}">
                <TextBlock Text="530i" />
            <lc:LayoutItem Label="HP:">
                <TextBlock Text="225" />
            <lc:LayoutItem Label="# of Gears:">
                <TextBlock Text="5" />


See Also