ArcGIS Pro 2.7 API Reference Guide
RecalculateRenderer() Method

ArcGIS.Desktop.Mapping Namespace > FeatureLayer Class > RecalculateRenderer Method : RecalculateRenderer() Method
Updates the renderer based on updated values from the data source. This method must be called on the MCT. Use QueuedTask.Run
Syntax
public void RecalculateRenderer()
Public Overloads Sub RecalculateRenderer() 
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Error HRESULT {0} has been returned from a call to a COM component
Remarks
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