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.v24.2.dll
NuGet Package: DevExpress.Wpf.Docking
#Declaration
public bool Move(
BaseLayoutItem item,
BaseLayoutItem target,
MoveType type,
int insertIndex
)
#Parameters
Name | Type | Description |
---|---|---|
item | Base |
A Base |
target | Base |
A Base |
type | Move |
A DevExpress. |
insert |
Int32 | An integer value that specifies the zero-based index at which the Base |
#Returns
Type | Description |
---|---|
Boolean | true if the item has been sucsessfully moved; otherwise, false. |
#Remarks
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:
private void Button_Click(object sender, RoutedEventArgs e) {
//Moving the controlItem3 to the first group and placing it between existing items (insertIndex = 1)
dockLayoutManager1.LayoutController.Move(controlItem3, myGroup1, DevExpress.Xpf.Layout.Core.MoveType.InsideGroup, 1); }