# Selection

**RadTreeMap** and **RadPivotMap** support selection functionality which is disabled by default. You can enable it by setting the control's **IsSelectionEnabled** property to **True**.

> The following examples use **RadTreeMap** but the same properties are exposed by the **RadPivotMap** control as well.

```XAML
<telerik:RadTreeMap IsSelectionEnabled="True"/>
```

```C#
treeMap.IsSelectionEnabled = true;
```

```VB.NET
	treeMap.IsSelectionEnabled = True
```

## Selection Modes

The selection feature supports several modes which you can set through the **SelectionMode** property.

* **Single** (default value): This mode allows selection of a single item only. Clicking an item will select it and deselect the previously selected one, if there is such.
* **Multiple**: This mode allows selection of multiple items. Clicking an item will select it and it will keep the previously selected items.
* **Extended**: This mode combines the Single and Multiple modes. Clicking an item deselect the others, however, if the Ctrl key is pressed the previous selection will be preserved.

```XAML
<telerik:RadTreeMap SelectionMode="Extended" />
```

```C#
treeMap.SelectionMode = System.Windows.Controls.SelectionMode.Extended;
```

```VB.NET
	treeMap.SelectionMode = System.Windows.Controls.SelectionMode.Extended
```

## Related Properties

**RadTreeMap** and **RadPivotMap** controls expose several properties which allow you to access the current selected item(s).

* **SelectedItem**: Gets the selected item.
* **SelectedItems**: Gets a read-only collection that contains the selected items.
* **SelectedValue**: Gets or sets a value from the SelectedItem.
* **SelectedValuePath**: Gets or sets a path that is used to get the SelectedValue for the SelectedItem.

## Events

There are couple events which are fired when the selection is changed - **SelectionChanged** and **PreviewSelectionChanged**. Their handlers use an object of type **SelectionChangedRoutedEventArgs** as a second parameter that holds information about the selection.

## See Also

* [Overview](https://www.telerik.com/products/wpf/documentation/controls/radtreemap/overview)
* [SDK Examples](https://www.telerik.com/products/wpf/documentation/controls/radtreemap/sdk-examples)
* [Populating With Data RadTreeMap](https://www.telerik.com/products/wpf/documentation/controls/radtreemap/populating-with-data-radtreemap)
* [Populating With Data RadPivotMap](https://www.telerik.com/products/wpf/documentation/controls/radtreemap/populating-with-data-radpivotmap)
