Skip to main content

ColumnBase.CellToolTipTemplate Property

Gets or sets a template that defines the appearance of cell tooltips. This is a dependency property.

Namespace: DevExpress.WinUI.Grid

Assembly: DevExpress.WinUI.Grid.v23.2.dll

NuGet Package: DevExpress.WinUI

Declaration

[DP(null)]
public DataTemplate CellToolTipTemplate { get; set; }

Property Value

Type Description
DataTemplate

A template that defines the appearance of cell tooltips. The template’s data context is a CellData object.

Remarks

The following code sample uses the hidden unbound column to calculate the total value and displays this value in the cell tooltip:

WinUI Grid - Custom Cell Tooltip

<dxg:GridControl ...>
    <dxg:GridControl.Columns>
        <dxg:GridTextColumn FieldName="ProductName">
            <dxg:GridTextColumn.CellToolTipTemplate>
                <DataTemplate x:DataType="dxg:CellData">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Total Price:" FontWeight="Bold" FontSize="14"/>
                        <TextBlock Text=" $" FontSize="14"/>
                        <TextBlock Text="{x:Bind UnboundData['Total'].ToString()}" FontSize="14"/>
                    </StackPanel>
                </DataTemplate>
            </dxg:GridTextColumn.CellToolTipTemplate>
        </dxg:GridTextColumn>
        <!-- ... -->
        <dxg:GridTextColumn FieldName="Total" UnboundType="Decimal" 
                            UnboundExpression="[UnitPrice]*[Quantity]" Visible="False"/>
    </dxg:GridControl.Columns>
</dxg:GridControl>
See Also