Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeMapControl.GroupHeaderContentTemplate Property

Gets or sets the template used to display the group header’s content in a treemap.

Namespace: DevExpress.Xpf.TreeMap

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

NuGet Package: DevExpress.Wpf.TreeMap

#Declaration

[NonCategorized]
public DataTemplate GroupHeaderContentTemplate { get; set; }

#Property Value

Type Description
DataTemplate

A DataTemplate object that specifies the template used to display the group header.

#Remarks

The following example customizes appearance of treemap group headers:

Run Demo: Selection

<local:TreeMapDemoModule
    x:Class="TreeMapDemo.Selection"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    xmlns:dxct="http://schemas.devexpress.com/winfx/2008/xaml/charts/themekeys"
    xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
    xmlns:dxt="http://schemas.devexpress.com/winfx/2008/xaml/core/themekeys"
    xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
    xmlns:dxtm="http://schemas.devexpress.com/winfx/2008/xaml/treemap"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:TreeMapDemo">

    <Grid>
        <dxtm:TreeMapControl x:Name="treeMap">
            <dxtm:TreeMapControl.TreeMapStyle>
                <dxtm:TreeMapStyle
                    GroupBackground="Transparent"
                    GroupFontSize="12" />
            </dxtm:TreeMapControl.TreeMapStyle>
            <dxtm:TreeMapControl.GroupHeaderContentTemplate>
                <DataTemplate>
                    <TextBlock
                        Text="{Binding Label}"
                        Foreground="{dxi:ThemeResource {dxct:ChartBrushesThemeKey ResourceKey=TitleForeground}}"
                        FontWeight="{Binding FontWeight}"
                        FontSize="{Binding FontSize}"
                        TextTrimming="WordEllipsis"
                        Margin="4" />
                </DataTemplate>
            </dxtm:TreeMapControl.GroupHeaderContentTemplate>
    </Grid>
</local:TreeMapDemoModule>
See Also