Back to Devexpress

SunburstControl.DataAdapter Property

windowsforms-devexpress-dot-xtratreemap-dot-sunburstcontrol.md

latest4.8 KB
Original Source

SunburstControl.DataAdapter Property

Gets or sets the data adapter for a Sunburst control.

Namespace : DevExpress.XtraTreeMap

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

NuGet Package : DevExpress.Win.TreeMap

Declaration

csharp
[XtraSerializableProperty(XtraSerializationVisibility.Hidden)]
public ISunburstDataAdapter DataAdapter { get; set; }
vb
<XtraSerializableProperty(XtraSerializationVisibility.Hidden)>
Public Property DataAdapter As ISunburstDataAdapter

Property Value

TypeDescription
ISunburstDataAdapter

An object of a class that implements the ISunburstDataAdapter interface.

|

Example

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

Create a SunburstFlatDataAdapter object and assign it to the SunburstControl.DataAdapter property to provide flat data to the Sunburst. Then, specify the adapter’s SunburstFlatDataAdapter.DataSource, SunburstFlatDataAdapter.LabelDataMember and SunburstFlatDataAdapter.ValueDataMember to define data source members that should be used to generate sunburst items. Add data members to the SunburstFlatDataAdapter.GroupDataMembers collection to specify how to group the sunburst’s items.

csharp
private void OnLoad(object sender, EventArgs e) {
    SunburstFlatDataAdapter dataAdapter = new SunburstFlatDataAdapter();            
    dataAdapter.ValueDataMember = "Annual";
    dataAdapter.LabelDataMember = "Product";
    dataAdapter.GroupDataMembers.AddRange(new string[] { "Category", "Country" });
    dataAdapter.DataSource = CreateProductInfos();
    sunburstControl.DataAdapter = dataAdapter;
}
vb
Class SurroundingClass
    Private Sub OnLoad(ByVal sender As Object, ByVal e As EventArgs)
        Dim dataAdapter As SunburstFlatDataAdapter = New SunburstFlatDataAdapter()
        dataAdapter.ValueDataMember = "Annual" 
        dataAdapter.LabelDataMember = "Product" 
        dataAdapter.GroupDataMembers.AddRange(New String() {"Category", "Country"})
        dataAdapter.DataSource = CreateProductInfos()
        sunburstControl.DataAdapter = dataAdapter
    End Sub 
End Class

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataAdapter 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.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/SunburstChart/SunburstItemControlProvider.cs#L33

csharp
this.dataAdapter = new SunburstFlatDataAdapter();
sunburst.DataAdapter = dataAdapter;
toolTipController = new ToolTipController();

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/SunburstChart/SunburstItemControlProvider.vb#L39

vb
Me.dataAdapter = New SunburstFlatDataAdapter()
sunburst.DataAdapter = dataAdapter
toolTipController = New ToolTipController()

See Also

SunburstControl Class

SunburstControl Members

DevExpress.XtraTreeMap Namespace