ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / StandaloneTableFactory Class / CreateStandaloneTable Method / CreateStandaloneTable(StandaloneTableCreationParams,IStandaloneTableContainerEdit) Method
A StandaloneTableCreationParams object.
A map or group layer where the StandaloneTable will be added
Example

In This Topic
    CreateStandaloneTable(StandaloneTableCreationParams,IStandaloneTableContainerEdit) Method
    In This Topic
    Creates a new StandaloneTable instance using the specified StandaloneTableCreationParams and adds it to a container such as a map. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    tableParams
    A StandaloneTableCreationParams object.
    container
    A map or group layer where the StandaloneTable will be added

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    StandaloneTableCreationParams or container is null.
    Example
    Create a StandaloneTable
      //container can be a map or group layer
      var container = MapView.Active.Map;
      //var container =  MapView.Active.Map.GetLayersAsFlattenedList()
      //                                  .OfType<GroupLayer>().First();
      QueuedTask.Run(() =>
      {
        //use a local path
        var table = StandaloneTableFactory.Instance.CreateStandaloneTable(
      new Uri(@"C:\Temp\Data\SDK.gdb\EarthquakeDamage", UriKind.Absolute),
      container);
        //use a URI to a feature service table endpoint
        var table2 = StandaloneTableFactory.Instance.CreateStandaloneTable(
    new Uri(@"https://bexdog.esri.com/server/rest/services/FeatureServer" + "/2", UriKind.Absolute),
    container);
        //Use an item
        var item = ItemFactory.Instance.Create(@"C:\Temp\Data\SDK.gdb\ParcelOwners");
        var tableCreationParams = new StandaloneTableCreationParams(item);
        var table3 = StandaloneTableFactory.Instance.CreateStandaloneTable(tableCreationParams, container);
    
        //use table creation params
        var table_params = new StandaloneTableCreationParams(item)
        {
          // At 2.x - DefinitionFilter = new CIMDefinitionFilter()
          //{
          //  //optional - use a filter
          //  DefinitionExpression = "LAND_USE = 3"
          //}
          DefinitionQuery = new DefinitionQuery(whereClause: "LAND_USE = 3", name: "Landuse")
        };
        var table4 = StandaloneTableFactory.Instance.CreateStandaloneTable(table_params,
                                 container);
    
      });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also