Binding DataGridCell ToolTip property to value of DataGridCell Binding DataGridCell ToolTip property to value of DataGridCell wpf wpf

Binding DataGridCell ToolTip property to value of DataGridCell


Use this Style :

<Style TargetType="DataGridCell">    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self},Path=Content.Text}"/> </Style>


Try just setting the ToolTip to the DataGridCell's DataContext like so:

<DataGridTextColumn.CellStyle>        <Style TargetType="DataGridCell">            <Setter Property="ToolTip" Value="{Binding}" />        </Style></DataGridTextColumn.CellStyle>

If you do not get the desired content you can then specify the converter as well:

<DataGridTextColumn.CellStyle>        <Style TargetType="DataGridCell">            <Setter Property="ToolTip" Value="{Binding Converter={StaticResource BooleanToYesNoConverter}}" />        </Style></DataGridTextColumn.CellStyle>