Back to Devexpress

BaseLayoutItem.Move(LayoutItemDragController) Method

windowsforms-devexpress-dot-xtralayout-dot-baselayoutitem-dot-move-x28-devexpress-dot-xtralayout-dot-customization-dot-layoutitemdragcontroller-x29.md

latest3.2 KB
Original Source

BaseLayoutItem.Move(LayoutItemDragController) Method

Moves the item to the specified position within the LayoutControl.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual bool Move(
    LayoutItemDragController controller
)
vb
Public Overridable Function Move(
    controller As LayoutItemDragController
) As Boolean

Parameters

NameTypeDescription
controllerLayoutItemDragController

A LayoutItemDragController object whose settings determine the position to which the layout item should be moved.

|

Returns

TypeDescription
Boolean

true if the item was successfully moved to a new position; otherwise, false.

|

Remarks

To move an item to a specific position, create a LayoutItemDragController object. It’s settings should identify the position to which the current item must be moved. Then call the Move method and pass the LayoutItemDragController object.

Example

The following code shows how to move a layout item to a different position via code. An item is moved using the BaseLayoutItem.Move method.

Initially two layout items are displayed one under another:

In the example the second item is positioned on the right of the first layout item.

csharp
using DevExpress.XtraLayout.Utils;
using DevExpress.XtraLayout.Customization;

LayoutItemDragController dragController = new LayoutItemDragController(layoutControlItem2, 
  layoutControlItem1, MoveType.Inside, InsertLocation.After, LayoutType.Horizontal);
layoutControlItem2.Move(dragController);
vb
Imports DevExpress.XtraLayout.Utils
Imports DevExpress.XtraLayout.Customization

Dim dragController As LayoutItemDragController = _
  New LayoutItemDragController(layoutControlItem2, layoutControlItem1, _
  MoveType.Inside, InsertLocation.After, LayoutType.Horizontal)
layoutControlItem2.Move(dragController)

See Also

BaseLayoutItem Class

BaseLayoutItem Members

DevExpress.XtraLayout Namespace