Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Highlighting and Selection

The TreeMap control supports item highlighting and selection.

To enable (or disable) tree map item highlighting, set the TreeMapControl.EnableHighlighting property to true (false).

TreeMapControl_EnableHighlighting

To configure selection mode, specify the TreeMapControl.SelectionMode property.

TreeMapControl_SelectionMode

The Tree Map control allows you to specify or obtain the selected item using code. To do this, use the TreeMapControl.SelectedItem property or the TreeMapControl.SelectedItems collection if SelectionMode equals to Multiple or Extended.

<TextBlock Text="{Binding ElementName=treeMap, Path=SelectedItem.Name, StringFormat=Country Name: {0}}"/>
<TextBlock Text="{Binding ElementName=treeMap, Path=SelectedItem.Gdp, StringFormat=Gdp: {0:C0}B}"/>

To perform actions when item selection changes, handle the TreeMapControl.SelectionChanged event.

// ...
treeMap.SelectionChanged += OnSelectionChanged;
// ...

void OnSelectionChanged(object sender, TreeMapSelectionChangedEventArgs e) {
    // Perform actions that should be done when selection changes.
}
See Also