A newer version of this page is available. Switch to the current version.

BarDockInfo.ContainerType Property

Gets or sets the type of container that displays the current bar. This value matches the BarContainerControl.ContainerType property. This is a dependency property.

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v19.2.dll


public BarContainerType ContainerType { get; set; }

Property Value

Type Description

A BarContainerType value that specifies the type of container that displays the current bar.

Available values:

Name Description

Identifies a bar container that can be freely docked and positioned within the form, and that can be horizontal or vertical. Use the BarContainerControl.Orientation property to change the orientation of these containers.


Identifies the bar container that is designed to display bars at the left of the window.


Identifies the bar container that is designed to display bars at the top of the window.


Identifies the bar container that is designed to display bars at the right of the window.


Identifies the bar container that is designed to display bars at the bottom of the window.


Identifies a floating bar container, used to display floating bars.


For a bar to be displayed on-screen, it must be associated with a specific bar container (a BarContainerControl object). It can be associated with a bar container via the BarDockInfo.Container, BarDockInfo.ContainerName or ContainerType property.

Setting the ContainerType property locates a BarContainerControl object whose BarContainerControl.ContainerType property's value matches the assigned value. If this container is found, it's assigned to the BarDockInfo.Container property, and its name is assigned to the BarDockInfo.ContainerName property.


This example shows how to get and focus an editor embedded into a bar.In the example bars are added to BarContainers that are automatically created by setting the BarManager.CreateStandardLayout property to True.

<!--Set CreateStandardLayout to True  to create four BarContainers 
at the top, left, right, and bottom edges-->
<dxb:BarManager CreateStandardLayout="True" Margin="12" Name="barManager1">
        <dxb:BarButtonItem x:Name="btn" Content="button" ItemClick="btn_ItemClick" />
        <dxb:BarEditItem x:Name="beiEditor" EditValue="text">

        <dxb:Bar x:Name="topBar" Caption="Top Bar">
            <!--Display the bar within the top BarContainer-->
                <dxb:BarDockInfo ContainerType="Top" />
                <dxb:BarButtonItemLink BarItemName="btn" />
                <dxb:BarEditItemLink BarItemName="beiEditor" />
        <dxb:Bar x:Name="leftBar" Caption="Left Bar">
            <!--Display the bar within the left BarContainer-->
                <dxb:BarDockInfo ContainerType="Left" />
                <dxb:BarButtonItemLink BarItemName="btn" />                        

private void btn_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
    (beiEditor.Links[0] as BarEditItemLink).Editor.Focus();


This example shows how to manually create different types of bar containers: 1) A bar container used to display bars at the top of the window, 2) A float bar container (it's created automatically when setting the Bar.DockInfo.ContainerType property to Floating), 3) A standalone bar container that can be freely positioned within the window.

The following image shows the result:


    <dxb:Bar x:Name="barFormat" Caption="Format">
            <dxb:BarDockInfo ContainerType="Top" />
            <dxb:BarCheckItemLink BarItemName="btnBold" />
            <dxb:BarCheckItemLink BarItemName="btnItalic" />
            <dxb:BarCheckItemLink BarItemName="btnUnderline" />
    <!--Create a floating bar-->
    <dxb:Bar x:Name="barFont" Caption="Font">
            <dxb:BarDockInfo ContainerType="Floating" FloatBarOffset="100,100" />
            <dxb:BarButtonItemLink BarItemName="btnFont" />
    <!--Create a bar displayed in the standalone container-->
    <dxb:Bar x:Name="barAlignment" Caption="Alignment">
            <dxb:BarDockInfo ContainerName="StandaloneContainer" />
            <dxb:BarCheckItemLink BarItemName="btnLeft" />
            <dxb:BarCheckItemLink BarItemName="btnCenter" />
            <dxb:BarCheckItemLink BarItemName="btnRight" />
            <dxb:BarCheckItemLink BarItemName="btnJustify" />
<!--Create containers to display bars-->
<DockPanel Name="dockPanel1" LastChildFill="False">
    <dxb:BarContainerControl x:Name="TopBarContainer"
                             DockPanel.Dock="Top" />
    <dxe:TextEdit Name="textBox"
                  EditValue="Sample text"
                  TextElement.FontSize="13" />
    <dxb:BarContainerControl x:Name="StandaloneContainer"
                             Orientation="Horizontal" />
See Also