Hi Infragistics,
We have a Style for a XamNumericInput which is working well. When we attempt to apply our standard ErrorTemplate onto this Style, it doesn't seem to work.
The full style is as follows...
<Style x:Key="XamNumericInputPartNumber" TargetType="{x:Type ig:XamNumericInput}"> <Setter Property="Width" Value="50"/> <Setter Property="Margin" Value="5"/> <Setter Property="ValueTypeName" Value="Int32"/> <Setter Property="SpinButtonDisplayMode" Value="Always"/> <Setter Property="PromptChar" Value=""/> <Setter Property="Mask" Value="{}{number:1-999}"/> <Setter Property="Validation.ErrorTemplate"> <Setter.Value> <ControlTemplate> <DockPanel LastChildFill="True"> <Border Background="Blue" DockPanel.Dock="Right" Margin="5,0,0,0" Width="20" Height="20" CornerRadius="10" ToolTip="{Binding ElementName=customAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"> <TextBlock Text="!" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" Foreground="White"/> </Border> <AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center"> <Border BorderBrush="Blue" BorderThickness="1"/> </AdornedElementPlaceholder> </DockPanel> </ControlTemplate> </Setter.Value> </Setter> </Style>
I've attached an example of what the ErrorTemplate should look like.
Any help would be much appreciated.
Regards, ifdef
I should add...
We're not trying to validate the number that's entered as such. The mask of 1-999 takes care of that.
Post entry, we need to check that the particular number is not reserved, just before the user clicks Save. If the number is reserved, we use IDataErrorInfo to set the relevant error for that property.
Hello,
Thank you for your post. I have been looking into it, but it seems like that I am missing something in your scenario, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.
Unfortunately it's not easy to create an isolated project for this scenario.
But if you add an error template to a style, you will see it doesn't show in an error state (using IDataErrorInfo)
There were some issue with this, which are now fixed internally for version 14.2 and 15.1. The fixes will be available in out next service releases.
Hi Stefan,
Any updates on this please?
Duplicate post removed.
We've downloaded the new 14.2 Service Release and whilst it appears to have fixed this issue, it's created others.
We're now correctly seeing our custom Error Template around the XamNumericInput (in blue)...
But we're still seeing the Ingragistics built-in version (in Red) which then clashes..
Our template is defined like so...
<Style x:Key="ValidatedXamNumericInput" TargetType="{x:Type ig:XamNumericInput}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
...
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
And this should override the template in the Infragistics style.
Please could you advise.