Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
XamNumericInput ErrorTemplate Remains
posted

Hi Infragistics,

We're using the latest 14.2 Service Release and have discovered the following issue.

A Style has been defined to accept a valid range, in this case a year...

<Style x:Key="ValidatedXamNumericInputYear" TargetType="{x:Type ig:XamNumericInput}">

    <Setter Property="Width" Value="60"/>

    <Setter Property="ValueTypeName" Value="Int32"/>

    <Setter Property="SpinButtonDisplayMode" Value="Always"/>

    <Setter Property="PromptChar" Value=""/>

    <Setter Property="NullText" Value="{Binding Source={x:Static sys:DateTime.Today}, Path=Year}"/>

    <Setter Property="InvalidValueBehavior" Value="RevertValue"/>

    <Setter Property="ValueConstraint">

        <Setter.Value>

            <ig:ValueConstraint ValidateAsType="Integer32" MinInclusive="1982" MaxInclusive="2100"/>

        </Setter.Value>

    </Setter>

</Style>

If the contents of the input is then cleared\deleted and a valid number re-entered, the ErrorTemplate remains...

The control XMAL is...

<ig:XamNumericInput Style="{StaticResource ValidatedXamNumericInputYear}" Value="{Binding Path=<ViewModelProperty>, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>

I believe there is also a second issue that is linked.

The documentation states that the Value property will only be updated if the value is valid. In the case of the above entering 1 (for example) still updates the Value property even though it's invalid. This causes issues as the ViewModelProperty is then updated with an incorrect value.