Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 2.08 KB

File metadata and controls

46 lines (35 loc) · 2.08 KB

How to show tooltip for Stacked Headers in WPF DataGrid (SfDataGrid)?

About the sample

This example illustrates how to show tooltip for Stacked Headers in WPF DataGrid (SfDataGrid).

WPF DataGrid (SfDataGrid) doesn’t have direct support to show tooltip for the stacked header cell. However you can enable tooltip for the stacked header cells by including Style with TargetType as GridStackedHeaderCellControl.

<Window.Resources>
    <Style TargetType="syncfusion:GridStackedHeaderCellControl">
        <Setter Property="ToolTip">
            <Setter.Value>
                <TextBlock Text="{Binding HeaderText}" ToolTipService.IsEnabled="True" 
                            ToolTipService.ShowOnDisabled="True"/>
            </Setter.Value>
        </Setter>
        <Setter Property="ToolTipService.IsEnabled" Value="True" />
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
    </Style>
</Window.Resources>

<Grid>
    <syncfusion:SfDataGrid Name="dataGrid"
                           AllowFiltering="True"
                           ItemsSource="{Binding OrdersListDetails}">
        <syncfusion:SfDataGrid.StackedHeaderRows>
            <syncfusion:StackedHeaderRow>
                <syncfusion:StackedHeaderRow.StackedColumns>
                    <syncfusion:StackedColumn ChildColumns="OrderID,ProductName,Quantity" HeaderText="Order Details" MappingName="OrderDetails"/>
                    <syncfusion:StackedColumn ChildColumns="CustomerID,ContactNumber" HeaderText="Customer Details" MappingName="CustomerDetails"/>
                </syncfusion:StackedHeaderRow.StackedColumns>
            </syncfusion:StackedHeaderRow>
        </syncfusion:SfDataGrid.StackedHeaderRows>
    </syncfusion:SfDataGrid>

ToolTip for Stacked Headers

KB article - How to show tooltip for Stacked Headers in WPF DataGrid (SfDataGrid)?

Requirements to run the demo

Visual Studio 2015 and above versions.