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

SunburstHierarchicalDataAdapter.DataSource Property

Gets or sets the object that is the data adapter’s data source.

Namespace: DevExpress.XtraTreeMap

Assembly: DevExpress.XtraTreeMap.v18.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

This example demonstrates how to visualize hierarchical data using the SunburstControl.

Create a SunburstHierarchicalDataAdapter object and assign it to the SunburstControl.DataAdapter property to provide hierarchical data to a Sunburst. Then, specify the adapter’s data source object using the SunburstHierarchicalDataAdapter.DataSource property. Populate the SunburstHierarchicalDataAdapter.Mappings collection with SunburstHierarchicalDataMapping objects to configure how the SunburstControl should convert hierarchical data to sunburst items. The HierarchicalDataMapping.LabelDataMember property allows you to specify a label data member, the HierarchicalDataMapping.ValueDataMember property - a value data member, the HierarchicalDataMapping.ChildrenDataMember property - a data member that contains children items and the HierarchicalDataMapping.Type property - types of items at the current level.

Note

A complete sample project is available at How to: provide hierarchical data to Sunburst.

private void OnFormLoad(object sender, EventArgs e) {
    SunburstHierarchicalDataAdapter dataAdapter = new SunburstHierarchicalDataAdapter();
    dataAdapter.Mappings.Add(new SunburstHierarchicalDataMapping {
        Type = typeof(CountryInfo), 
        LabelDataMember = "CountryName",  
        ChildrenDataMember = "CityInfos"
    });
    dataAdapter.Mappings.Add(new SunburstHierarchicalDataMapping {
        Type = typeof(CityInfo),  
        LabelDataMember = "CityName",              
        ChildrenDataMember = "SaleInfos"
    });
    dataAdapter.Mappings.Add(new SunburstHierarchicalDataMapping {
        Type = typeof(ProductInfo),
        ValueDataMember = "Total",
        LabelDataMember = "Category",
    });
    dataAdapter.DataSource = CreateInfos();
    sunburstControl.DataAdapter = dataAdapter;
}

The following code snippets (auto-collected from DevExpress Examples) contain references 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