ArcGIS Pro 2.6 API Reference Guide
CreateFeatureLayer(FeatureClass,ILayerContainerEdit,Int32,String,RendererDefinition) Method

ArcGIS.Desktop.Mapping Namespace > LayerFactory Class > CreateFeatureLayer Method : CreateFeatureLayer(FeatureClass,ILayerContainerEdit,Int32,String,RendererDefinition) Method
An ArcGIS.Core.Data.FeatureClas
A map or group layer instance to which the Feature Layer will be added
The position of the Feature Layer in the map or group layer. 0 represents the top most position.
(optional) When it is not provided, the default display name gets used e.g. the dataset name or alias. (default value = "")
(optional) Provide a RendererDefinition to create a FeatureLayer with your custom renderer instead of the default renderer that gets generated automatically. (default value = null)
Overloaded. Create a new Feature Layer instance using an ArcGIS.Core.Data.FeatureClas and adds that to a container such as a map or group layer. Optionally you can provide a name and rendererDefinition to override the default display name and renderer respectively. This method must be called on the MCT. Use QueuedTask.Run
Syntax

Parameters

featureClass
An ArcGIS.Core.Data.FeatureClas
mapOrGroupLayer
A map or group layer instance to which the Feature Layer will be added
index
The position of the Feature Layer in the map or group layer. 0 represents the top most position.
layerName
(optional) When it is not provided, the default display name gets used e.g. the dataset name or alias. (default value = "")
rendererDefinition
(optional) Provide a RendererDefinition to create a FeatureLayer with your custom renderer instead of the default renderer that gets generated automatically. (default value = null)

Return Value

Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

LayerFactory Class
LayerFactory Members
Overload List