Back to Devexpress

LayoutGroup.GroupBorderStyle Property

wpf-devexpress-dot-xpf-dot-docking-dot-layoutgroup-537e6ef8.md

latest6.1 KB
Original Source

LayoutGroup.GroupBorderStyle Property

Gets or sets the group’s border style. This option is in effect when the LayoutGroup is used to combine layout items. This is a dependency property.

Namespace : DevExpress.Xpf.Docking

Assembly : DevExpress.Xpf.Docking.v25.2.dll

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public virtual GroupBorderStyle GroupBorderStyle { get; set; }
vb
Public Overridable Property GroupBorderStyle As GroupBorderStyle

Property Value

TypeDescription
GroupBorderStyle

A GroupBorderStyle value that specifies the group’s border style.

|

Available values:

NameDescription
NoBorder

A container has no borders.

| | Group |

A container is displayed with borders and a caption.

| | GroupBox |

A container is displayed with borders and a title bar.

| | Tabbed |

Child items are displayed as tabs.

|

Remarks

Set the BaseLayoutItem.ShowCaption property to false to hide the group’s caption that the BaseLayoutItem.Caption property specifies.

You can increase indents for groups without borders. Refer to the LayoutGroup.HasAccent for more information.

Note

Group border styles can vary based on the application’s DevExpress Theme.

Expand a LayoutGroup on the TitleBar Click

The following code snippet expands the myGroup LayoutGroup when you click its group box title:

xaml
<Window ...
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
    <dxdo:DockLayoutManager >
        <dxdo:LayoutGroup Orientation="Vertical" >
            <dxdo:LayoutGroup Name="myGroup" GroupBorderStyle="GroupBox" Caption="Group" ShowCaption="True" PreviewMouseLeftButtonUp="myGroup_PreviewMouseLeftButtonUp">
                <dxdo:LayoutControlItem>
                    <dxe:TextEdit EditValue="Text"/>
                </dxdo:LayoutControlItem>
                <dxdo:LayoutGroup.CaptionTemplate>
                    <DataTemplate>
                        <TextBlock Background="White" PreviewMouseLeftButtonDown="TextBlock_PreviewMouseLeftButtonDown" Text="{Binding}" />
                    </DataTemplate>
                </dxdo:LayoutGroup.CaptionTemplate>
            </dxdo:LayoutGroup>
            <dxdo:LayoutPanel/>
        </dxdo:LayoutGroup>
    </dxdo:DockLayoutManager>

</Window>
csharp
using System;
using DevExpress.Xpf.Docking;

// ...

    private void myGroup_PreviewMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
        LayoutGroup layoutGroup = (LayoutGroup)sender;
        if (layoutGroup != null) {
            if (!layoutGroup.IsExpanded) {
                layoutGroup.Expanded = true;
                e.Handled = true;
            }
        }
    }
vb
Imports System.Windows
Imports DevExpress.Xpf.Docking

    Private Sub myGroup_PreviewMouseLeftButtonUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
        Dim layoutGroup As LayoutGroup = CType(sender, LayoutGroup)

        If layoutGroup IsNot Nothing Then

            If Not layoutGroup.IsExpanded Then
                layoutGroup.Expanded = True
                e.Handled = True
            End If
        End If
    End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GroupBorderStyle property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-dock-layout-manager-limit-layout-group-customization-at-runtime/CS/DXDockingForLayoutPurposes/MainWindow.xaml#L21

xml
<dxd:DockLayoutManager>
    <dxd:LayoutGroup Name="generalLayoutGroup" GroupBorderStyle="GroupBox" ShowCaption="True" Caption="General" Orientation="Vertical">
        <dxd:LayoutControlItem Name="incidentNumber" Caption="Incident Number" VerticalAlignment="Top">

See Also

HasAccent

Caption

Margin

Padding

ShowCaption

LayoutGroup Class

LayoutGroup Members

DevExpress.Xpf.Docking Namespace