ArcGIS Pro 2.8 API Reference Guide
CreateGroupLayer Method (LayerFactory)

ArcGIS.Desktop.Mapping Namespace > LayerFactory Class : CreateGroupLayer Method
A layer container i.e. a map or another group layer where the group layer will belong to.
A 0-based index represents the position of the group layer within the container - 0 means it will added to the very top as the first layer in the container.
Name of the group layer
Create a group layer. This method must be called on the MCT. Use QueuedTask.Run
Syntax
Public Function CreateGroupLayer( _
   ByVal container As ILayerContainerEdit, _
   ByVal index As Integer, _
   Optional ByVal layerName As String _
) As GroupLayer

Parameters

container
A layer container i.e. a map or another group layer where the group layer will belong to.
index
A 0-based index represents the position of the group layer within the container - 0 means it will added to the very top as the first layer in the container.
layerName
Name of the group layer
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

LayerFactory Class
LayerFactory Members