Skip to main content

InsertLocation Enum

Lists the values that specify the position to which a layout item is inserted.

Namespace: DevExpress.XtraLayout.Utils

Assembly: DevExpress.XtraLayout.v24.2.dll

Declaration

public enum InsertLocation

Members

Name Description
After

To insert an item after the specified one.

Before

To insert an item before the specified one.

Related API Members

The following properties accept/return InsertLocation values:

Remarks

To move an item to a specific position in code, a LayoutItemDragController object should be created and passed to the BaseLayoutItem.Move method. The drag controller’s settings specify the processed layout item and position to which it must be moved. This includes:

  • the target layout item before or after which the processed item is inserted;
  • whether the item is inserted before or after the target item, etc.

The values listed by the InsertLocation enumeration are used to specify whether the item is inserted before or after the specified item.

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:

LayoutItem_Move_ex_before

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

LayoutItem_Move_ex_after

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

LayoutItemDragController dragController = new LayoutItemDragController(layoutControlItem2, 
  layoutControlItem1, MoveType.Inside, InsertLocation.After, LayoutType.Horizontal);
layoutControlItem2.Move(dragController);
See Also