ArcGIS Pro 2.7 API Reference Guide
RecalculateRenderer(FeatureRendererTarget) Method

ArcGIS.Desktop.Mapping Namespace > FeatureLayer Class > RecalculateRenderer Method : RecalculateRenderer(FeatureRendererTarget) Method
A FeatureRendererTarget indicating the intended usage of the resulting renderer. Valid arguments for this method are FeatureRendererTarget.Default and FeatureRendererTarget.PreviousObservations.
Updates the renderer based on updated values from the data source. For example, if a new unique value gets added to the FeatureClass, in case of unique value renderer, it gets updated with the newly added value. Similarly with class breaks renderer, it tries best to preserve the number of class breaks and recalculates the break values based on the updated values. This method must be called on the MCT. Use QueuedTask.Run
Syntax
public void RecalculateRenderer( 
   FeatureRendererTarget featureRendererTarget
)
Public Overloads Sub RecalculateRenderer( _
   ByVal featureRendererTarget As FeatureRendererTarget _
) 

Parameters

featureRendererTarget
A FeatureRendererTarget indicating the intended usage of the resulting renderer. Valid arguments for this method are FeatureRendererTarget.Default and FeatureRendererTarget.PreviousObservations.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
This method was called with an unsupported FeatureRendererTarget value.
Error HRESULT {0} has been returned from a call to a COM component
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 a new unique value is added to the underlying FeatureClass, in case of a unique value renderer, it gets updated with the newly added value. Similarly with class breaks renderer, RecalculateRenderer tries best to preserve the number of class breaks and recalculates the break values based on the updated values.
RecalculateRenderer is not supported for proportional renderer. Calling RecalculateRenderer on a layer with a proportional renderer will throw a System.Runtime.InteropServices.COMException. Calling RecalculateRenderer on a layer with a unique value renderer or class breaks renderer that has a null color ramp (check the renderer's ColorRamp property via the CIM) will throw a System.Runtime.InteropServices.COMException.
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

FeatureLayer Class
FeatureLayer Members
Overload List