windowsforms-devexpress-dot-xtralayout-dot-utils-8a3c52f5.md
Lists the values that specify the position to which a layout item is inserted.
Namespace : DevExpress.XtraLayout.Utils
Assembly : DevExpress.XtraLayout.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public enum InsertLocation
Public Enum InsertLocation
| Name | Description |
|---|---|
After |
To insert an item after the specified one.
|
| Before |
To insert an item before the specified one.
|
The following properties accept/return InsertLocation values:
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 values listed by the InsertLocation enumeration are used to specify whether the item is inserted before or after the specified item.
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.
using DevExpress.XtraLayout.Utils;
using DevExpress.XtraLayout.Customization;
LayoutItemDragController dragController = new LayoutItemDragController(layoutControlItem2,
layoutControlItem1, MoveType.Inside, InsertLocation.After, LayoutType.Horizontal);
layoutControlItem2.Move(dragController);
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