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
Members
Description | ||
---|---|---|
Add | Adds an object id to the selection set. | |
AddList | Adds a list of object id's to the selection set. | |
Combine | Combines this selection set with another selection set using the specified set operation. | |
Count | The number of oids in the selection set. | |
FullName | The full name of the selection set. | |
IDs | Enumerates the object ids in the selection set. | |
MakePermanent | Makes the SelectionSet permanent. By default SelectionSets are deleted when released. | |
Refresh | Refreshes the state of a snapshot selection. | |
RemoveList | Removes a list of object id's from the selection set. | |
Search | Returns a cursor that can be used to retrieve the objects specified by a query over this selection set. | |
Select | Returns a new selection That contains the object ids selected by a query over this selection set. | |
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).
- ID sets are persisted as a list of Object IDs. When a row is requested from this type of selection set, the row is retrieved from the source table. This guarantees the most current version of the row will be retrieved.
- Snapshots are a cache of in-memory row objects. Snapshots will always contain the version of the row as it was when the selection was made.
- Hybrids determine how they are stored based on their current size. Initially, they behave as snapshots, but if they grow beyond a certain point, they will behave like ID sets. Hybrids can be used when the usage pattern isn't dependent on whether the newest version or an older version of a row will be used.
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.