I would like to override the original error template to do the following
- add an warning icon at the back of the control
- add the error content to the tooltip of the icon with converter to convert the error content from error code to error message for validation from Model that implemented IDataErrorInfo interface.
I tried to do it as follows but it doesn't work. Is there anything wrong or there is another solution in handling this case?
- add an warning icon at the back of the control
- add the error content to the tooltip of the icon with converter to convert the error content from error code to error message for validation from Model that implemented IDataErrorInfo interface.
I tried to do it as follows but it doesn't work. Is there anything wrong or there is another solution in handling this case?
<ControlTemplate x:Key="GeneralErrorTemplate">
<Grid>
<Border BorderBrush="#66FF0000" BorderThickness="3">
<AdornedElementPlaceholder x:Name="adorner" />
</Border>
<Image Source"/Images/error.png"
ToolTip="{Binding ElementName=adorner, Path=AdornedElement.(Validation.Errors).CurrentItem.ErrorContent, Converter={x:Static con:CodeConverter.Instance}}">
</Image>
</Grid>
</ControlTemplate>
<telerik:GridViewDataColumn Header="Value" DataMemberBinding="{Binding Value, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource GeneralErrorTemplate}">
</telerik:GridViewDataColumn>