Skip to main content

LayoutController.Move(BaseLayoutItem, BaseLayoutItem, MoveType, Int32) Method

Moves the BaseLayoutItem next to another item or into another group at the precise position, specified by an insertIndex parameter.

Namespace: DevExpress.Xpf.Docking

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


public bool Move(
    BaseLayoutItem item,
    BaseLayoutItem target,
    MoveType type,
    int insertIndex


Name Type Description
item BaseLayoutItem

A BaseLayoutItem to move.

target BaseLayoutItem

A BaseLayoutItem in relation to which the specified element is moved.

type MoveType

A DevExpress.Xpf.Layout.Core.MoveType enumeration value specifying how the item is moved.

insertIndex Int32

An integer value that specifies the zero-based index at which the BaseLayoutItem should be inserted. If it is negative or exceeds the number of items within the target container, an exception is thrown.


Type Description

true if the item has been sucsessfully moved; otherwise, false.


An item cannot be moved if the BaseLayoutItem.AllowMove option is disabled. After an item has been moved, the DockLayoutManager.LayoutItemMoved event fires.

The insertIndex parameter only makes sense if the type parameter is set to the MoveType.InsideGroup.

Below is an example of re-arranging LayoutControlItems via the Move method. The item ‘Control item 3’ is being moved from ‘myGroup2’ to ‘myGroup1’ and placed between two existing ‘myGroup1’ items:

DXDocking Move Method Result

<dxdo:LayoutGroup Orientation="Vertical">
    <!--First Group-->
    <dxdo:LayoutGroup Orientation="Vertical" Name="myGroup1" GroupBorderStyle="GroupBox">
        <dxdo:LayoutControlItem Name="controlItem1" Caption="Control Item 1">
        <dxdo:LayoutControlItem Name="controlItem2" Caption="Control Item 2">
    <!--Second Group-->
    <dxdo:LayoutGroup Orientation="Vertical" Name="myGroup2" GroupBorderStyle="GroupBox">
        <dxdo:LayoutControlItem Name="controlItem3" Caption="Move me">
        <dxdo:LayoutControlItem Name="controlItem4" Caption="Re-arrage items">
            <Button Content="^" Click="Button_Click"/>
See Also