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

How to: Configure Highlighting and Selection

  • 2 minutes to read

To specify end-user permissions, use the TreeMapControl.EnableHighlighting and HierarchicalChartControlBase.SelectionMode properties.

using DevExpress.XtraTreeMap;
using System;
using System.Windows.Forms;

namespace HighlightingAndSelection {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e) {
            chkEnableHighlighting.Checked = treeMap.EnableHighlighting;

            lbSelectionMode.DataSource = Enum.GetValues(typeof(ElementSelectionMode));
            lbSelectionMode.SelectedValue = treeMap.SelectionMode;
        }

        private void chkEnableHighlighting_CheckedChanged(object sender, EventArgs e) {
            treeMap.EnableHighlighting = chkEnableHighlighting.Checked;
        }

        private void lbSelectionMode_SelectedIndexChanged(object sender, EventArgs e) {
            treeMap.SelectionMode = (ElementSelectionMode)lbSelectionMode.SelectedValue;
        }
    }
}