ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / BasicFeatureLayer Class / SelectionCount Property
Example

In This Topic
    SelectionCount Property (BasicFeatureLayer)
    In This Topic
    Gets the number of features selected in the layer.
    Syntax
    public int SelectionCount {get;}
    Public ReadOnly Property SelectionCount As Integer
    Example
    Count the features selected on a layer
    var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
    var noFeaturesSelected = lyr.SelectionCount;
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also