Skip to main content
A newer version of this page is available. .

TreeMapFlatDataAdapter.DataSource Property

Gets or sets the object that is the data source of the data adapter.

Namespace: DevExpress.XtraTreeMap

Assembly: DevExpress.XtraTreeMap.v19.2.dll

Declaration

[DefaultValue(null)]
public object DataSource { get; set; }

Property Value

Type Default Description
Object *null*

A Object that is the data source.

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;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataSource property.

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.

See Also