ArcGIS Pro 2.9 API Reference Guide
RemoveTemplate(MapMember,String) Method
Example 

ArcGIS.Desktop.Mapping Namespace > MappingExtensions Class > RemoveTemplate Method : RemoveTemplate(MapMember,String) Method
the map member containing the template.
the template name to be removed.
Removes a template from a map member.
Syntax
public static void RemoveTemplate( 
   MapMember member,
   string name
)
Public Overloads Shared Sub RemoveTemplate( _
   ByVal member As MapMember, _
   ByVal name As String _
) 

Parameters

member
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
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, Windows 8.1

See Also

Reference

MappingExtensions Class
MappingExtensions Members
Overload List