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

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