ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MappingExtensions Class / RemoveTemplate Method / RemoveTemplate(MapMember,String) Method
The map member containing the template.
The template name to be removed.
Example

In This Topic
    RemoveTemplate(MapMember,String) Method
    In This Topic
    Removes a template from a map member.
    Syntax
    public static void RemoveTemplate( 
       MapMember mapMember,
       string name
    )
    Public Overloads Shared Sub RemoveTemplate( _
       ByVal mapMember As MapMember, _
       ByVal name As String _
    ) 

    Parameters

    mapMember
    The map member containing the template.
    name
    The template name to be removed.
    Exceptions
    ExceptionDescription
    the Template cannot be found in the map member.
    Example
    Remove a table template
    var table = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().FirstOrDefault();
    if (table == null)
      return;
    QueuedTask.Run(() =>
    {
      var tableTemplate = table.GetTemplate("Template1");
      //Removing a table template
      table.RemoveTemplate(tableTemplate);
      //Removing a template by name
      table.RemoveTemplate("Template2");
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also