ArcGIS Pro 2.7 API Reference Guide
SetRenderer(CIMRenderer,FeatureRendererTarget) Method

ArcGIS.Desktop.Mapping Namespace > FeatureLayer Class > SetRenderer Method : SetRenderer(CIMRenderer,FeatureRendererTarget) Method
Your custom renderer that will be used to draw features of the feature layer.
A FeatureRendererTarget indicating the intended usage of the resulting renderer.
Specifies the feature layer's renderer object which determines how the layer draws. This method must be called on the MCT. Use QueuedTask.Run
Syntax

Parameters

updatedRenderer
Your custom renderer that will be used to draw features of the feature layer.
featureRendererTarget
A FeatureRendererTarget indicating the intended usage of the resulting renderer.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Renderer cannot be of type CIMHeatMapRenderer
Renderer cannot be of type CIMDotDensityRenderer
The provided renderer cannot be used as a {0} renderer for this layer
This feature layer does not support tracks
Remarks
Intended for use with StreamLayer. For non-stream layer types use FeatureRendererTarget.Default. Passing FeatureRendererTarget.PreviousObservations or FeatureRendererTarget.TrackLines for a non-track aware layer (feature or stream) will throw a System.InvalidOperationException. If the feature layer is a member of a SubtypeGroupLayer, the renderer argument passed cannot be of type CIMHeatMapRenderer or you will get a System.ArgumentException. If the feature layer is a member of a SubtypeGroupLayer and is in the 3D category of the table of contents in a 3D view, the renderer argument passed cannot be of type CIMDotDensityRenderer or you will get a System.ArgumentException. Use the IsSubtypeLayer property to determine if the feature layer is a member of a SubtypeGroupLayer. Use the SceneLayerType property to determine if the feature layer is in 3D category of the table of contents.
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

FeatureLayer Class
FeatureLayer Members
Overload List