This document is archived and information here might be outdated.  Recommended version.


IFeatureSelection Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IF > IFeatureSelection Interface
ArcGIS Developer Help

IFeatureSelection Interface

Provides access to members that control feature selection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Name Description
Method Add Adds a feature to the selection set.
Read/write property BufferDistance Buffer distance used for the selection.
Method Clear Clears the selection.
Read/write property CombinationMethod Combination method for the selection.
Method SelectFeatures Selects features based upon the specifed criteria and combination method.
Method SelectionChanged Fires the features layer update event. Required when SelectionSet changes.
Read/write property SelectionColor Selection color. (used when SetSelectionSymbol = FALSE).
Read/write property SelectionSet The selected set of features.
Read/write property SelectionSymbol Selection symbol.
Read/write property SetSelectionSymbol Indicates if the selected set of features is drawn using the SelectionSymbol.

Classes that implement IFeatureSelection

Classes Description
CadAnnotationLayer An Esri Cad annotation layer.
CadastralFabricSubLayer Cadastral Fabric Feature Layer Object.
CadFeatureLayer Esri CAD Feature Layer class.
CoverageAnnotationLayer An Esri coverage annotation layer.
DimensionLayer A collection of properties for a dimension layer.
FDOGraphicsLayer A collection of properties for an annotation layer (feature data object graphics layer).
FeatureLayer A collection of features and their visual representation.
GdbRasterCatalogLayer Geodabase RasterCatalog source and display options.
ImageServerLayer Image server layer source and display options.
IMSSubFeatureLayer A collection of IMS features as a sublayer of an IMSMapLayer.
TemporalFeatureLayer (esriTrackingAnalyst) Defines the coclass IDL parameters and attributes of the TemporalFeatureLayer COM object.

Remarks

IFeatureSelection is a very useful interface to manage or perform selection on a layer or to modify the way the selection is displayed.

The following methods and properties are useful to manage the selection:

The CombinationMethod property is not used.
SelectionSet returns a SelectionSet corresponding to the current selection on the layer.
Clear will clear an existing selection.
Add adds one single feature to the selection.
SelectFeatures will perform a selection based on a query filter. If nothing is used as a query filter all the features will be selected. You can also specify a combination method. The justOne parameter tells the search to stop once it has found one feature.
Call SelectionChanged after modifying SelectionSet to fire update events on the layer.

The following methods and properties are useful to modify the way the selection is displayed:

SelectionSymbol will return or set the symbol used to display selected features on the layer.
SetSelectionSymbol is a boolean used to indicate if the SelectionSymbol is used or not to draw the selection. For feature layers, this is similar to using the "Show selected features...with this symbol" option in the layer properties.
SelectionColor is equivalent to using the "Show selected features...with this color" option in the layer properties.
If BufferDistance is set to a value greater than 0, a buffer will be drawn around the selected features. This is similar to using the Buffer Selection tool that can be added to the map with the Customize command found in the Tools menu.

.NET Samples

Create camera flyby from path Custom reshape polyline edit task Custom vertex editing commands Custom vertex editing commands Executing geoprocessing tools in the background ArcGIS Network Analyst extension barrier location editor Custom selection extension Create a custom selection extension by extending ArcObjects Selection restriction evaluator