This question is locked. New answers and comments are not allowed.
I was wondering whether anyone might be able to help with my problem.
I have a grid which is bound to a collection of objects, I require to load a custom tooltip which will eventually contain a graph when the user hovers over a certain cell.
I can get the tooltip to display as expected but cant get the data binding correct, it always binds to the last rows data even when I hover over the first item.
To set the tool tip I use,
<controls:RadGridView.Columns>
<controls:GridViewDataColumn Header="Value" DataMemberBinding="{Binding Value}" ToolTipTemplate="{StaticResource GraphPreview}"/>
</controls:RadGridView.Columns>
And the tooltip is declared in the Grid Resources,
<DataTemplate x:Key="GraphPreview" >
<ToolTip Width="300" Height="150">
<ToolTip.Template>
<ControlTemplate TargetType="ToolTip">
<Border Background="{StaticResource BlackGradient}"
BorderBrush="{StaticResource DarkBlue}"
BorderThickness="1"
CornerRadius="10">
<ContentPresenter Margin="10" Content="{TemplateBinding Content}" />
</Border>
</ControlTemplate>
</ToolTip.Template>
<StackPanel Orientation="Vertical">
<TextBlock Foreground="White" Text="{Binding Name}"/>
<TextBlock Foreground="White" Text="{Binding Value}"/>
<TextBlock Foreground="White" Text="{Binding UnitType}"/>
<TextBlock Foreground="White" Text="{Binding SuperType}"/>
</StackPanel>
</ToolTip>
</DataTemplate>
I have a grid which is bound to a collection of objects, I require to load a custom tooltip which will eventually contain a graph when the user hovers over a certain cell.
I can get the tooltip to display as expected but cant get the data binding correct, it always binds to the last rows data even when I hover over the first item.
To set the tool tip I use,
<controls:RadGridView.Columns>
<controls:GridViewDataColumn Header="Value" DataMemberBinding="{Binding Value}" ToolTipTemplate="{StaticResource GraphPreview}"/>
</controls:RadGridView.Columns>
And the tooltip is declared in the Grid Resources,
<DataTemplate x:Key="GraphPreview" >
<ToolTip Width="300" Height="150">
<ToolTip.Template>
<ControlTemplate TargetType="ToolTip">
<Border Background="{StaticResource BlackGradient}"
BorderBrush="{StaticResource DarkBlue}"
BorderThickness="1"
CornerRadius="10">
<ContentPresenter Margin="10" Content="{TemplateBinding Content}" />
</Border>
</ControlTemplate>
</ToolTip.Template>
<StackPanel Orientation="Vertical">
<TextBlock Foreground="White" Text="{Binding Name}"/>
<TextBlock Foreground="White" Text="{Binding Value}"/>
<TextBlock Foreground="White" Text="{Binding UnitType}"/>
<TextBlock Foreground="White" Text="{Binding SuperType}"/>
</StackPanel>
</ToolTip>
</DataTemplate>