TreeMapFlatDataAdapter Class
The data adapter that provides flat data to a tree map.
Namespace: DevExpress.XtraTreeMap
Assembly: DevExpress.XtraTreeMap.v18.1.dll
Declaration
Remarks
This data adapter introduces the TreeMapFlatDataAdapter.DataSource property that allows you to specify the data source of the adapter, and the TreeMapFlatDataAdapter.DataMember, TreeMapFlatDataAdapter.LabelDataMember and TreeMapFlatDataAdapter.ValueDataMember properties, allowing you to specify the data members whose values are used as an item, item’s label and item’s value.
For more information about Data Adapters, refer to the Providing Data topic.
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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-provide-flat-data-to-treemap-t360926
void ConfigureTreeMapDataAdapter() {
TreeMapFlatDataAdapter adapter = new TreeMapFlatDataAdapter {
DataSource = CreateBillionaireInfos(),
LabelDataMember = "Name",
ValueDataMember = "NetWorth"
};
adapter.GroupDataMembers.Add("Residence");
treeMap.DataAdapter = adapter;
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the TreeMapFlatDataAdapter class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.