# Selection

## Content



TreeMap chart 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 <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/api/wpf/online-flexchart/dotnet-api/C1.WPF.Chart/C1.WPF.Chart.FlexChartBase.html\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/api/wpf/online-flexchart/dotnet-api/C1.WPF.Chart/C1.WPF.Chart.FlexChartBase.html\u0022\u003e.NET Framework\u003c/a\u003e." data-popup-title="FlexChartBase" data-popup-theme="ui-tooltip-green qtip-green">FlexChartBase</span> 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 data point in TreeMap.<br />

![Enable selection in TreeMap](https://cdn.mescius.io/document-site-files/images/8ba28e07-1633-4a6a-9114-13b9f1f04eed/images/treemap-selection.png)

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

```xml
<c1:C1TreeMap Binding="sales"
              MaxDepth="2"
              BindingName="type"
              ChildItemsPath="items"
              ItemsSource="{Binding DataContext.Data}"
              SelectionMode="Point">
```

### Customized TreeMap Selection

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

![Stylise Treemap selection](https://cdn.mescius.io/document-site-files/images/8ba28e07-1633-4a6a-9114-13b9f1f04eed/images/treemap-selectionstyle.png)

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

```xml
<c1:C1TreeMap Binding="sales"
              MaxDepth="2"
              BindingName="type"
              ChildItemsPath="items"
              ItemsSource="{Binding DataContext.Data}"
              SelectionMode="Point">
    <c1:C1TreeMap.SelectionStyle>
        <c1:ChartStyle Fill="Wheat"/>
    </c1:C1TreeMap.SelectionStyle>
```

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.

## See Also

[WPF TreeMap](/componentone/docs/wpf/online-flexchart/TreeMapOverview)

[Quick Start](/componentone/docs/wpf/online-flexchart/TreeMapOverview/TreeMapQuickStart)

[Key Features](/componentone/docs/wpf/online-flexchart/TreeMapOverview/TreeMapKeyFeatures)

[Elements](/componentone/docs/wpf/online-flexchart/TreeMapOverview/TreeMapElements)

[Layouts](/componentone/docs/wpf/online-flexchart/TreeMapOverview/TreeMapLayouts)

[Data Binding](/componentone/docs/wpf/online-flexchart/TreeMapOverview/TreeMapDataBinding)