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

TreeMapFlatDataAdapter Class

The data adapter that provides flat data to a tree map.

Namespace: DevExpress.Xpf.TreeMap

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

Declaration

public class TreeMapFlatDataAdapter :
    TreeMapDataAdapterBase,
    IFlatDataAdapter

Remarks

This data adapter introduces the TreeMapFlatDataAdapter.DataSource property that allows you to specify the data source of the adapter, and the TreeMapFlatDataAdapter.DataMember, TreeMapFlatDataAdapter.LabelDataMember and TreeMapFlatDataAdapter.ValueDataMember properties, allowing you to specify the data members whose values are used as an item, item’s label and item’s value.

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>

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

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