Reputation: 35400
Why wouldn't the following style work?
<DataGridTemplateColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Path=_FailCount, StringFormat='{}Fail Count = {0}'}" />
</Style>
</DataGridTemplateColumn.CellStyle>
Upvotes: 0
Views: 483
Reputation: 89285
Try to change your binding this way :
<Setter Property="ToolTip" Value="{Binding Path=[_FailCount], StringFormat='{}Fail Count = {0}'}" />
That should work given the DataContext is a DataRowView
, because that's the way we access a column value from DataRowView
object.
Upvotes: 1
Reputation: 222582
If you want to a cell, you can try ColumnHeader ,
Style TargetType="{x:Type Custom:DataGridColumnHeader}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="ToolTip" Value="{Binding Path=_FailCount, StringFormat='{}Fail Count = {0}'}", RelativeSource={RelativeSource Self}}"/>
</Trigger>
</Style.Triggers>
</Style>
Upvotes: 0