ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GroupLayer Class / RemoveStandaloneTable Method
The StandaloneTable to remove
Example

In This Topic
    RemoveStandaloneTable Method (GroupLayer)
    In This Topic
    Removes the specified StandaloneTable from the container or from a child container. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub RemoveStandaloneTable( _
       ByVal table As StandaloneTable _
    ) 
    public void RemoveStandaloneTable( 
       StandaloneTable table
    )

    Parameters

    table
    The StandaloneTable to remove
    Exceptions
    ExceptionDescription
    Invalid container. The StandaloneTable is not part of this container or one of it's descendants.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Remove 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);
    
        //Note: Run within a QueuedTask
        //get the tables from the map container
        var tables = map.GetStandaloneTablesAsFlattenedList();
        //delete the first...
        if (tables.Count() > 0)
        {
            map.RemoveStandaloneTable(tables.First());
            //or delete all of them
            map.RemoveStandaloneTables(tables);
        }
    
        //delete a table from a group layer
        //assumes it has at least one table...
        grp_layer.RemoveStandaloneTable(grp_layer.StandaloneTables.First());
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also