Skip to main content

TreeMapHierarchicalDataAdapter.DataSource Property

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

Namespace: DevExpress.Xpf.TreeMap

Assembly: DevExpress.Xpf.TreeMap.v23.2.dll

NuGet Package: DevExpress.Wpf.TreeMap

Declaration

public object DataSource { get; set; }

Property Value

Type Description
Object

A Object that is the data source.

Example

To provide hierarchical data to the Tree Map, do the following.

<Window.Resources>
    <HierarchicalDataTemplate 
        DataType="{x:Type local:SideOfWorld}"
        ItemsSource="{Binding Countries}">
        <TextBlock 
            Margin="4,4,4,-3"
            Padding="4,2,0,2"
            Text="{Binding Name}"
            Foreground="White"
            Background="Gray"/>
    </HierarchicalDataTemplate>
    <DataTemplate
        DataType="{x:Type local:Country}">
        <Grid>
            <TextBlock 
                Padding="4,2,0,0"
                Text="{Binding Name}" 
                TextWrapping="WrapWithOverflow" 
                TextTrimming="WordEllipsis"/>
            <Border 
                BorderThickness="1" 
                BorderBrush="#60000000"/>
        </Grid>
    </DataTemplate>
</Window.Resources>

<Grid>
    <dxtm:TreeMapControl>
        <dxtm:TreeMapControl.Colorizer>
            <dxtm:TreeMapPaletteColorizer>
                <dxtm:Office2013Palette/>
            </dxtm:TreeMapPaletteColorizer>
        </dxtm:TreeMapControl.Colorizer>
        <dxtm:TreeMapHierarchicalDataAdapter
            DataSource="{Binding}"
            ValueDataMember="Gdp">
        </dxtm:TreeMapHierarchicalDataAdapter>
    </dxtm:TreeMapControl>
</Grid>
See Also