Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 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

    HierarchicalChartControlBase.ToolTipContentTemplate Property

    Specifies a data template used to display the tooltip content of Sunburst or TreeMap items.

    Namespace: DevExpress.Xpf.TreeMap

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

    NuGet Package: DevExpress.Wpf.TreeMap

    #Declaration

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

    #Property Value

    Type Description
    DataTemplate

    A data template used to display the tooltip content of Sunburst or TreeMap items.

    #Remarks

    A ToolTipInfo object is the DataContext for the ToolTipContentTemplate.

    #Example

    The following properties allow you to customize TreeMap tooltips:

    <Window.Resources>
        <DataTemplate x:Key="tooltipContentTemplate">
            <StackPanel Orientation="Vertical"
                        Margin="8">
                <TextBlock Text="{Binding Item.Label}"
                           Foreground="White" 
                           FontSize="24"/>
                <TextBlock Text="{Binding Path=ToolTipText}"
                           Foreground="LightGray"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="tooltipTemplate">
            <Grid>
                <Border CornerRadius="8" 
                        Background="#FF303030">
                    <ContentPresenter Content="{Binding}" 
                                      ContentTemplate="{Binding ContentTemplate}"/>
                </Border>
            </Grid>
        </DataTemplate>
    </Window.Resources>
    <dxtm:TreeMapControl ToolTipEnabled="true"
                         ToolTipPattern="{}GDP: {V:C} millions"
                         ToolTipContentTemplate="{Binding Source={StaticResource tooltipContentTemplate}}"
                         ToolTipGroupPattern="{} Summary GDP: {V:C} millions"
                         ToolTipGroupContentTemplate="{Binding Source={StaticResource tooltipContentTemplate}}"
                         ToolTipTemplate="{Binding Source={StaticResource tooltipTemplate}}">
        <dxtm:TreeMapControl.ToolTipOptions>
            <dxtm:ToolTipOptions Position="{Binding ElementName=lbPosition, Path=SelectedValue}"
                                    OpenMode="{Binding ElementName=lbOpenMode, Path=SelectedValue}">
            </dxtm:ToolTipOptions>
        </dxtm:TreeMapControl.ToolTipOptions>
    </dxtm:TreeMapControl>
    <ListBox Grid.Row="1"
                x:Name="lbPosition"
                DisplayMemberPath="PositionName"
                SelectedValuePath="Position"
                SelectedIndex="0">
        <local:PositionWrapper PositionName="Mouse">
            <dxtm:ToolTipMousePosition/>
        </local:PositionWrapper>
        <local:PositionWrapper PositionName="Relative">
            <dxtm:ToolTipRelativePosition Origin="0.5 0"/>
        </local:PositionWrapper>
    </ListBox>
    <ListBox Grid.Row="3"
                x:Name="lbOpenMode"
                DisplayMemberPath="OpenModeName"
                SelectedValuePath="OpenMode"
                SelectedIndex="0">
        <local:OpenModeWrapper OpenModeName="On Hover" 
                                OpenMode="OnHover"/>
        <local:OpenModeWrapper OpenModeName="On Click" 
                                OpenMode="OnClick"/>
    </ListBox>
    
    See Also