ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / DiagramLayer Class / MoveLayer Method
A Layer to be moved.
The position specified by the 0-based index. -1 will move the table to the bottom of the container. If the index is invalid, the layer is moved to the bottom.

In This Topic
    MoveLayer Method (DiagramLayer)
    In This Topic
    Move a layer to another position within the container. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void MoveLayer( 
       Layer layer,
       int position
    )
    Public Sub MoveLayer( _
       ByVal layer As Layer, _
       ByVal position As Integer _
    ) 

    Parameters

    layer
    A Layer to be moved.
    position
    The position specified by the 0-based index. -1 will move the table to the bottom of the container. If the index is invalid, the layer is moved to the bottom.
    Exceptions
    ExceptionDescription
    The layer is null.
    Invalid container. The layer is not part of this diagram layer.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    The layer must already be part of this diagram layer.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.6 or higher.
    See Also