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

TreeMapControl.DataAdapter Property

Gets or sets the data adapter for a TreeMap control.

Namespace: DevExpress.XtraTreeMap

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

NuGet Package: DevExpress.Win.TreeMap

#Declaration

[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
public ITreeMapDataAdapter DataAdapter { get; set; }

#Property Value

Type Description
ITreeMapDataAdapter

An object of a class implementing the ITreeMapDataAdapter interface.

#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;
}
See Also