I have a datagrid with multiple columns. I want to display a tooltip when user hovers the mouse on the cell of one of those columns. Here is the code that I have tried:
<DataGridTextColumn Binding="{Binding PackageName}" MinWidth="250" IsReadOnly="True" ElementStyle="{StaticResource ResourceKey=StyleDataGridText}">
<DataGridTextColumn.HeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Background" Value="#E3E3E3"/>
</Style>
</DataGridTextColumn.HeaderStyle>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Info}" />
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.Header>
<DockPanel>
<TextBlock Text="Package Name"/>
<Image x:Name="SortPackageNameImg" Source="{StaticResource SortupImg}" Width="10" Height="10" Margin="10,0,0,0"></Image>
<Button Name="PackageNameFilterBtn" Click="PackageNameFilter_Click" HorizontalAlignment="Right" Margin="0,0,10,0">
<Button.Template>
<ControlTemplate>
<Image Source="/Resources/filter.png" Width="10" Height="10"/>
</ControlTemplate>
</Button.Template>
</Button>
</DockPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
But this is not working. Is there anything I need to change to fix this?