ComponentOne Grid for WPF: Grid for WPF Task-Based Help > Customizing the Grid's Appearance > Adding ToolTips to the Grid

Adding ToolTips to the Grid

You can add ToolTips to Grid for WPF to present information about the content of grid cells. For example, you can add ToolTips to each cell noting the content of that cell using the ItemCellPresenter class and binding the value of the ItemCellPresenter.ToolTip property to the ItemCell's Value property.

To do so, add the following XAML just after the <Grid> tag to add a style resource to the project:

<Grid.Resources>

    <Style TargetType="{x:Type c1grid:ItemCellPresenter}">

        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=ItemCell.Value}"/>

    </Style>

</Grid.Resources>

Run your application and observe:

Grid cells will now include a ToolTip containing the content of that grid cell:

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.