3 Answers, 1 is accepted
ValidationToolTip of a GridViewCell is custom styled ToolTip. Predefining the template of GridViewCell and modifying this ToolTip using Microsoft Expression Blend should do the trick.
Regards,
Vanya Pavlova
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
In fact they are separate, it depends on the validation mode. If you perform the validation in edit mode, you can see the ValidationToolTip of GridViewEditorPresenter. If you perform the validation in view mode, you will see the ValidationToolTip of GridViewCell. As far as I can understand you need to automatically open the tooltip. In both validation modes you should play with the ToolTip in order to show it in the correct position.
Something like the following (it's an example for the ValidationToolTip of GridViewEditorPresenter):
<Style TargetType="{x:Type telerik:GridViewEditorPresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type telerik:GridViewEditorPresenter}"> <Grid x:Name="root1"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="ValueStates"> <VisualState x:Name="Valid"/> <VisualState x:Name="InvalidFocusedState"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <Visibility>Visible</Visibility> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> <Popup Placement="Right" PlacementTarget="{Binding ElementName=root1}" IsOpen="True"> <Border x:Name="ValidationErrorElement" Background="Red" BorderBrush="Red" BorderThickness="1" CornerRadius="1" Margin="1,1,1,2" Visibility="Collapsed"> <ContentControl Content="{TemplateBinding ErrorMessage}" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,3,0" FontSize="10"> <ContentControl.ContentTemplate> <DataTemplate> <ItemsControl ItemsSource="{Binding}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock Margin="8,4,8,4" Foreground="White" FontWeight="Bold" TextWrapping="Wrap" Text="{Binding}"/> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </DataTemplate> </ContentControl.ContentTemplate> </ContentControl> </Border> </Popup> </Grid> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="VerticalAlignment" Value="Stretch"/> <Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="Padding" Value="1,1,2,2"/> </Style>
Absolutely the same can be applied to GridViewCell's ValidationToolTip template when you perform validation in view mode.
Hope this helps!
Vanya Pavlova
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.