ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GroupLayer Class / MoveStandaloneTable Method / MoveStandaloneTable(StandaloneTable,Int32) Method
A StandaloneTable 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 StandaloneTable is moved to the bottom.
Example

In This Topic
    MoveStandaloneTable(StandaloneTable,Int32) Method
    In This Topic
    Moves a StandaloneTable to a position within this container. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void MoveStandaloneTable( 
       StandaloneTable table,
       int position
    )
    Public Overloads Sub MoveStandaloneTable( _
       ByVal table As StandaloneTable, _
       ByVal position As Integer _
    ) 

    Parameters

    table
    A StandaloneTable 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 StandaloneTable is moved to the bottom.
    Exceptions
    ExceptionDescription
    The table is null.
    Invalid container. The StandaloneTable is not part of this container or one of it's descendents.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    The StandaloneTable must already be part of this container or one of it's descendents. To move the StandaloneTable to a different container use MoveStandaloneTable(StandaloneTable,CompositeLayerWithTables,Int32) or Map.MoveStandaloneTable. To move the StandaloneTable to the root of the TOC use Map.MoveStandaloneTable.
    Example
    Move a Standalone table
    //get the first group layer that has at least one table
    var grp_layer = MapView.Active.Map.GetLayersAsFlattenedList()
      .OfType<GroupLayer>().First(g => g.StandaloneTables.Count > 0);
    var map = MapView.Active.Map;//assumes non-null
    QueuedTask.Run(() =>
    {
      //move the first table to the bottom of the container
      grp_layer.MoveStandaloneTable(grp_layer.StandaloneTables.First(), -1);
    
      //move the last table in the map standalone tables to a group
      //layer and place it at position 3. If 3 is invalid, the table
      //will be placed at the bottom of the target container
      //assumes the map has at least one standalone table...
      var table = map.StandaloneTables.Last();
      map.MoveStandaloneTable(table, grp_layer, 3);
    
      //move a table from a group layer to the map standalone tables
      //collection - assumes a table called 'Earthquakes' exists
      var table2 = grp_layer.FindStandaloneTables("Earthquakes").First();
      //move to the map container
      map.MoveStandaloneTable(table2, 0);//will be placed at the top
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also