Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 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

TreeMapControl Class

Displays flat and hierarchical data by using nested rectangles. See TreeMap Control.

Namespace: DevExpress.XtraTreeMap

Assembly: DevExpress.XtraTreeMap.v24.1.UI.dll

NuGet Package: DevExpress.Win.TreeMap

#Declaration

[ComVisible(true)]
public class TreeMapControl :
    HierarchicalChartControlBase

The following members return TreeMapControl objects:

#Remarks

The DevExpress WinForms TreeMap Control provides all the functionality required to display tree maps in your WinForms applications. You are free to use a data source representing flat data and group it, or the hierarchical data source for visualization.

The control has built-in item highlighting, selection and tooltips.

The following image demonstrates a TreeMapControl.

TreeMapControl

To get acquainted with using the TreeMapControl, please refer to the Getting Started section.

#Example

To provide flat data to a TreeMap, create a TreeMapFlatDataAdapter object and assign it to the TreeMapControl.DataAdapter property. Then, specify the adapter’s TreeMapFlatDataAdapter.DataSource, TreeMapFlatDataAdapter.LabelDataMember and TreeMapFlatDataAdapter.ValueDataMember to configure the data source object and which data members should be used to generate tree map items. If you need to group generated items, add the name of a data member whose values should be used to group items, to the TreeMapFlatDataAdapter.GroupDataMembers collection.

void ConfigureTreeMapDataAdapter() {
    TreeMapFlatDataAdapter adapter = new TreeMapFlatDataAdapter {
        DataSource = CreateBillionaireInfos(),
        LabelDataMember = "Name",
        ValueDataMember = "NetWorth"
    };
    adapter.GroupDataMembers.Add("Residence");
    treeMap.DataAdapter = adapter;
}

#Implements

#Inheritance

Object
MarshalByRefObject
Component
Control
DevExpress.XtraEditors.XtraControl
See Also