ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / BasicFeatureLayer Class / SupportsCustomSelectionProperties Method
Example

In This Topic
    SupportsCustomSelectionProperties Method
    In This Topic
    Gets if the layer type supports custom selection properties; specifically if the layer can display its selection in a custom color.
    Syntax
    public bool SupportsCustomSelectionProperties()
    Public Function SupportsCustomSelectionProperties() As Boolean

    Return Value

    True if the layer supports the custom selection proeprties.
    Example
    Change the layer selection color - using Layer methods
    {
      await QueuedTask.Run(() =>
      {
        if (featureLayer.SupportsCustomSelectionProperties())
        {
        // get the set of properties
        var (useCustomSelectioncolur, customSelectionColor, usecustomSelectioinFilleColor, customSelectionFillColor) = featureLayer.GetCustomSelectionProperties();
    
        // set the layer to use a specific color
        featureLayer.SetCustomSelectionColor(ColorFactory.Instance.RedRGB);
    
        // or set a specific color AND fill color
        featureLayer.SetCustomSelectionColor(ColorFactory.Instance.RedRGB, ColorFactory.Instance.BlueRGB);
    
        // reset to use the default selection color
          featureLayer.SetUseDefaultSelectionColor();
        }
    
        if (!featureLayer.IsVisible)
        {
          featureLayer.SetVisibility(true);
        }
        //Do a selection
        mapView.SelectFeatures(mapView.Extent);
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.8 or higher.
    See Also