ArcGIS Pro 3.4 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 Version

RemoveTemplate(MapMember,String) Method
Removes a template from a map member.
Syntax
public static void RemoveTemplate( 
   MapMember mapMember,
   string name
)

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