# Selection

## Content



TreeMap lets you enable selection of its data items and groups. User can select a node and draw focus on it by simply clicking it. You need to set the SelectionMode property provided by the ChartBase class to either of the following values in the ChartSelectionMode enumeration:

*   **None (default)**: Selection is disabled.

*   **Point**: A point is selected.

The following image illustrates default selection of a data point along with its children nodes in the hierarchy.<br />

![Enable selection in TreeMap](https://cdn.mescius.io/document-site-files/images/b011ec9b-8b9c-49b7-96b6-ebd2d5673a5e/images/treemap-selection.png)

The following code snippet shows how to set the **SelectionMode** property for a tree map control.

```csharp
// Implement selection mode

treeMap.SelectionMode = ChartSelectionModeType.Point;
```

### Customized TreeMap Selection

To customize the TreeMap selection, you can use SelectionStyle property and style the selected item as illustrated in the following image.

![Stylise Treemap selection](https://cdn.mescius.io/document-site-files/images/b011ec9b-8b9c-49b7-96b6-ebd2d5673a5e/images/treemap-selectionstyle.png)

The following code snippet demonstrates using of **SelectionStyle** property to change fill color of the selected TreeMap node.

```csharp
// Apply custom color to the selection

treeMap.SelectionStyle.Fill = Color.Wheat;
```

Additionally, you can customize the behavior of TreeMap selection by handling **SelectionChanged** event. Also, you can utilize **SelectedIndex** and **SelectedItem** properties, and reuse the obtained information in your application.