All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

DockingOptions.AllowDockToCenter Property

Gets or sets whether or not panels can dock to the middle of the DockManager's parent container (Form or UserControl).

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v20.1.dll

Declaration

[DefaultValue(DefaultBoolean.Default)]
[XtraSerializableProperty]
public DefaultBoolean AllowDockToCenter { get; set; }
<DefaultValue(DefaultBoolean.Default)>
<XtraSerializableProperty>
Public Property AllowDockToCenter As DefaultBoolean

Property Value

Type Default Description
DefaultBoolean

Default

The DefaultBoolean enumerator value that specifies whether or not this DockManager allows docking its panels to the container center. The DefaultBoolean.Default value is equivalent to DefaultBoolean.True.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to AllowDockToCenter
WinForms Controls SnapDockManager
.DockingOptions.AllowDockToCenter
DockManager
.DockingOptions.AllowDockToCenter
Reporting XRDesignDockManager
.DockingOptions.AllowDockToCenter
XRDesignDockManager
.DockingOptions.AllowDockToCenter

Remarks

If the AllowDockToCenter option is enabled, both you at design time and your users at runtime can drag a panel into the central docking hint of a parent container.

addDT

After the first panel is docked to the container middle, you can dock more panels to the center as tabs, or to this central panel's sides.

addMore

To dock panels to the central area in code, use the DockPanel.DockTo(DockPanel, DockingStyle) method.

dockManager1.Clear();

DockPanel p1 = new DockPanel() { Text = "Panel 1" };
DockPanel p2 = new DockPanel() { Text = "Panel 2" };
DockPanel p3 = new DockPanel() { Text = "Panel 3" };
DockPanel p4 = new DockPanel() { Text = "Panel 4" };
DockPanel p5 = new DockPanel() { Text = "Panel 5"};
DockPanel p6 = new DockPanel() { Text = "Panel 6"};
DockPanel p7 = new DockPanel() { Text = "Panel 7" };

dockManager1.AddPanel(DockingStyle.Left, p1);
dockManager1.AddPanel(DockingStyle.Top, p2);
dockManager1.AddPanel(DockingStyle.Right, p3);
dockManager1.AddPanel(DockingStyle.Bottom, p4);
dockManager1.AddPanel(DockingStyle.Fill, p5);
dockManager1.AddPanel(DockingStyle.Float, p6);
dockManager1.AddPanel(DockingStyle.Float, p7);

p6.DockTo(p5, DockingStyle.Left);
p7.DockTo(p5, DockingStyle.Fill);

code

To prevent a specific panel from docking to the container center, handle the DockManager.ShowingDockGuides event and disable the central dock guide.

private void DockManager1_ShowingDockGuides(object sender, ShowingDockGuidesEventArgs e)
{
    if (e.Panel == p7 && e.TargetPanel == null)
        e.Configuration.Disable(DevExpress.XtraBars.Docking2010.Customization.DockGuide.Center);
}
See Also