Skip to main content

Cell Tooltip

The Cell tooltip is a hint displayed when a user moves the mouse pointer over a grid cell.

WPF_Grid_CellTooltip_VE.png

To show a Cell tooltip, follow the steps below:

  1. Specify the BaseColumn.CellToolTipBinding property for columns that should display cell tooltips.

  2. Use the BaseColumn.CellToolTipTemplate or DataViewBase.CellToolTipTemplate property to define a cell tooltip template.

<dxg:GridControl ItemsSource="{Binding Source}">
    <dxg:GridColumn FieldName="Id"/>
    <dxg:GridColumn FieldName="Name" CellToolTipBinding="{Binding}"/>
    <dxg:GridColumn FieldName="Age" CellToolTipBinding="{Binding}"/>

    <dxg:GridControl.View>
        <dxg:TableView>
            <dxg:TableView.CellToolTipTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontWeight="Bold" Text="Name: "/>
                            <TextBlock Text="{Binding Name}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontStyle="Italic" FontWeight="Bold" Text="Age: "/>
                            <TextBlock Text="{Binding Age}"/>
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </dxg:TableView.CellToolTipTemplate>
        </dxg:TableView>
    </dxg:GridControl.View>
</dxg:GridControl>

The GridControl displays cell tooltips for trimmed text even if you define a custom Cell tooltip. To hide tooltips for the trimmed text, set the TextEditSettings.ShowTooltipForTrimmedText property to false.

See Also