<DataGridTextColumn Header="Last Study" Binding="{Binding XPath=History/Assignment[1]/@Study}" IsReadOnly="True"><DataGridTextColumn.CellStyle><Style TargetType="DataGridCell"><Setter Property="ToolTip" Value="{Binding Source={StaticResource StudyPoints}, Path=[0].Title}" /></Style></DataGridTextColumn.CellStyle></DataGridTextColumn>
In the above XAML markup I am setting the cell ToolTip property to the value of the first index entry in a resource:
<Setter Property="ToolTip" Value="{Binding Source={StaticResource StudyPoints}, Path=[0].Title}" />In the following XAML markup I use a different approach which displays the cell contents as the ToolTip:
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self},Path=Content.Text}"/>The markup:
<DataGridTextColumn Header="Last Study" Binding="{Binding XPath=History/Assignment[1]/@Study}" IsReadOnly="True"><DataGridTextColumn.CellStyle><Style TargetType="DataGridCell"><Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self},Path=Content.Text}"/></Style></DataGridTextColumn.CellStyle></DataGridTextColumn>My problem is I want to combine the two. I need something like:
IndexVariable = {Binding RelativeSource={RelativeSource Self},Path=Content.Text}<Setter Property="ToolTip" Value="{Binding Source={StaticResource StudyPoints}, Path=[IndexVariable].Title}" />
But I do not know how to do it.
Andrew