I have a Data grid and I display some data in it. I want a tooltip to be displayed if the data that I want to fit in the column of the data grid is too long. All the solutions I found use a separate class to achieve that. Is there a way to achieve the same thing with the help of a method only ?
I found the following solution in the link given.
<TextBlock Text="{Binding Text}">
<TextBlock.ToolTip>
<ToolTip
DataContext="{Binding Path=PlacementTarget, RelativeSource={x:Static RelativeSource.Self}}"
Visibility="{Binding Converter={StaticResource toolVisConverter}}">
<TextBlock Text="{Binding Text}"/> <!-- tooltip content -->
</ToolTip>
</TextBlock.ToolTip>
But it talks about a converter. Should I include that converter in view model or code behind file of .xaml file ?
at the same time, it says ti change the text block width in that converter. I don't know how to access Text block width in view model. I am totally new to WPF. Can someone help pls ?