Skip to main content

TreeMapControl.DataAdapter Property

Gets or sets the data adapter for a TreeMap Control.

Namespace: DevExpress.Xpf.TreeMap

Assembly: DevExpress.Xpf.TreeMap.v24.1.dll

NuGet Package: DevExpress.Wpf.TreeMap

Declaration

public TreeMapDataAdapterBase DataAdapter { get; set; }

Property Value

Type Description
TreeMapDataAdapterBase

A TreeMapDataAdapterBase class descendant object.

Remarks

This property is the Content Property of the Tree Map Control.

Example

To provide flat data to the Tree Map, perform the following steps.

<Window.Resources>
    <XmlDataProvider 
        x:Key="gdpDataSource" 
        Source="Data/top10gdp.xml"/>
    <DataTemplate 
        x:Key="headerTemplate">
        <Border 
            BorderBrush="#606060" 
            BorderThickness="1" 
            Margin="4,4,4,-4">
            <TextBlock 
                Padding="6,2,0,2"
                Text="{Binding Label}"
                Background="#808080"
                Foreground="White"/>
        </Border>
    </DataTemplate>
</Window.Resources>
<Grid>
    <dxtm:TreeMapControl>
        <dxtm:TreeMapControl.Colorizer>
            <dxtm:TreeMapPaletteColorizer>
                <dxtm:Office2016Palette/>
            </dxtm:TreeMapPaletteColorizer>
        </dxtm:TreeMapControl.Colorizer>
        <dxtm:TreeMapFlatDataAdapter 
            DataSource="{Binding Source={StaticResource gdpDataSource}}"
            DataMember="Country"
            LabelDataMember="Name"
            ValueDataMember="Gdp">
            <dxtm:TreeMapFlatDataAdapter.Groups>
                <dxtm:GroupDefinitionCollection>
                    <dxtm:TreeMapGroupDefinition 
                        GroupDataMember="SideOfWorld"
                        HeaderContentTemplate="{Binding Source={StaticResource headerTemplate}}"/>
                </dxtm:GroupDefinitionCollection>
            </dxtm:TreeMapFlatDataAdapter.Groups>
        </dxtm:TreeMapFlatDataAdapter>
    </dxtm:TreeMapControl>
</Grid>
See Also