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


ISelectionSet Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (GeoDatabase)  

ISelectionSet Interface

Provides access to members that manage a set of selected table rows or features. Note: the ISelectionSet interface has been superseded byISelectionSet2. Please consider using the more recent version.

Product Availability

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

Members

Description
Method Add Adds an object id to the selection set.
Method AddList Adds a list of object id's to the selection set.
Method Combine Combines this selection set with another selection set using the specified set operation.
Read-only property Count The number of oids in the selection set.
Read-only property FullName The full name of the selection set.
Read-only property IDs Enumerates the object ids in the selection set.
Method MakePermanent Makes the SelectionSet permanent. By default SelectionSets are deleted when released.
Method Refresh Refreshes the state of a snapshot selection.
Method RemoveList Removes a list of object id's from the selection set.
Method Search Returns a cursor that can be used to retrieve the objects specified by a query over this selection set.
Method Select Returns a new selection That contains the object ids selected by a query over this selection set.
Read-only property Target The Table or FeatureClass over which the selection set is defined.

CoClasses that implement ISelectionSet

CoClasses and Classes Description
RelQueryTableSelectionSet Esri RelQueryTable Selection object.
SelectionSet Esri Selection Set object.
TMSSelectSet (esriTrackingAnalyst) Controls the tracking selection set.

Remarks

A SelectionSet is used to reference a set of rows or features. This can be used to retrieve, process and select rows or features. 

A SelectionSet can be obtained from IFeatureClass::Select or ITable::Select.

If you want to obtain a selection set on a feature layer it is good practice to cast the layer to the ITable interface then use the ITable::Select method. The table that you will obtain this way will mirror the content of the layer even if it has a definition query or a join.

The IFeatureSelection interface contains a SelectionSet property which can be used to access or set the selection on a feature layer. If trying to set the selection with this property you must make sure that the content of the selection set is compatible with the features currently in the layer. It is usually simpler to use IFeatureSelection::SelectFeatures instead.

Selection sets are also used in a number of other interfaces dealing with the selection: ITableSort, IFeatureSelection, ITableSelection, ISelectFeaturesOperation, to name a few.

There are three types of selection sets: ID sets, snapshots, and hybrids. A selection set's type is determined at creation time (for example, by the selType parameter of the IFeatureClass.Select method).

Two of the methods defined by this interface should not be used in .NET or Java applications - AddList and RemoveList. See the IGeoDatabaseBridge2 interface for interop-safe alternatives.

.NET Snippets

Zoom to Selected Globe Features

.NET Samples

Custom reshape polyline edit task (Code Files: ReshapePolylineEditTask) | ArcGIS Network Analyst extension Engine application (Code Files: frmLoadLocations) | Selection restriction evaluator (Code Files: SelectionRestrictionEvaluator) | Custom vertex editing commands (Code Files: CustomVertexCommands UsingOutOfBoxVertexCommands) | ArcGIS Network Analyst extension barrier location editor (Code Files: NABarrierLocationEditor) | Subset network evaluators (Code Files: SubsetHelperUI) | Create camera flyby from path (Code Files: frmCameraPath) | Migrating from VB6 to VB .NET for ArcGIS 10 (Code Files: ButtonAddIn clscopy_table_sel clsCopyTableSelection)

.NET Related Topics

Executing spatial queries | Geodatabase | How to merge conflicting geometries during a reconcile | How to zoom to selected features in globe | Migrating VB6 to VB.NET for ArcGIS 10 | Sorting tables | Validating features