ToolTips for Controls that Reside in the CellValuePresenter
I currently have a Control that I have bound in a control template for the XamDataGrid CellValuePresenter. The control itself can contain many UI Entities (Rectangles) that each have their own ToolTip set through binding.
I would like to see the tooltips when I hover over each of these elements, but currently I cannot find a way to make that work with the XamDataGrid, it seems to be blocking the ToolTip on the inner UI elements.
Any assistance you can provide on this matter would be appreciated.
My control template is set to a custom user control, this is the control template:
<ControlTemplate x:Key="projectionMonthCell" TargetType="igDP:CellValuePresenter">
<Border Background="{TemplateBinding Background}">
<mkCom:ProjectionMonthCell
IsEnabled="False"
DataContext="{TemplateBinding Value}">
</mkCom:ProjectionMonthCell>
</Border>
</ControlTemplate>
This is the user control:
<Grid Name="ProjectionMonthCellGrid" Background="Transparent">
<Grid.Resources>
<Converters1:MarketActivityTypeEnumToFillValueConverter x:Key="enumToFillConverter" />
<Converters1:MarketActivityMonthSpanToRectangleWidthConverter x:Key="monthSpanToWidthConverter" />
<Converters1:MarketActivityMonthSpanToRectangleMarginConverter x:Key="monthSpanToMarginConverter" />
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<!-- Form Content Row -->
</Grid.RowDefinitions>
<ItemsControl HorizontalAlignment="Center" ItemsSource="{Binding Activity}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical">
</StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Rectangle Fill="{Binding Parent.MarketActivityType, Converter={StaticResource enumToFillConverter}}"
Width="{Binding Self, Converter={StaticResource monthSpanToWidthConverter}, ConverterParameter=90}"
Margin="{Binding Self, Converter={StaticResource monthSpanToMarginConverter}, ConverterParameter=90}"
ToolTip="{Binding FullInfo}"
Height="20">
</Rectangle>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
Hello,
This style displays two different tooltips for the two rectangles depending on which the mouse is over
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid ToolTip="Grid">
<Rectangle Width="20" Height="20" HorizontalAlignment="Left" Fill="Green" ToolTip="Green"/>
<Rectangle Width="20" Height="20" HorizontalAlignment="Right" Fill="red" ToolTip="Red"/>
</Setter.Value>
</Setter>
</Style>
Can you please provide your control template for the CVP. Are elements overlapping in it?