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
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)
Hi Stefan,
Apologies for taking so long to reply, but I had to move onto something else.
I'm back on this (with Infragistics 14.2) and still have the same issue.
We have our own error template style for the standard .Net controls, and would like to use this for the Infragistics controls as well. For consistency.
If we try and apply the style like so, it never shows when in an error state...
<ig:XamNumericInput Style="{StaticResource XamNumericInputPartNumber}" />
Hello,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
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.
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.