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

IContentsView.SelectedItem Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > ArcMapUI > ESRI.ArcGIS.ArcMapUI > Interfaces > IC > IContentsView Interface > IContentsView.SelectedItem Property
ArcGIS Developer Help

IContentsView.SelectedItem Property

The selected item (could be an enumerator).

[Visual Basic .NET]
Public Property SelectedItem As Object
public object SelectedItem {get; set;}

Product Availability

Available with ArcGIS Desktop.


This property is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView this property has several usages:

1. The property can be a single object of any of the following types:

IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)

2. The property can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so when setting this property using a Set, the Set should contain items of the same type.

3. The property can be an array where the contents of the array represent the hierarchical path to a single selected item. This is common when a single legend class is selected.

For example: If Array(0) = pMap, Array(1) = pLayer, Array(2) = pLegendGroup, and Array(3) = n, then the selected item is the nth legend class in pLegendGroup. When setting or adding to the selection, pass higher-level objects (in this case the IMap and ILayer objects) to improve peformance.

4. The property can be an array which contains an array of the structure explained in 3. This is common when multiple legend classes are selected.

See Also

IContentsView Interface

.NET Samples

Custom UI elements using add-ins