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.Value does not honour constraint
posted

Hi Infragistics,

The documentation states that the Value property will only be updated if the value entered is valid.

Let's say we have a ValueConstraint as follows (in a style)...

<Setter Property="ValueConstraint">

    <Setter.Value>

        <ig:ValueConstraint ValidateAsType="Integer32" MinInclusive="10" MaxInclusive="1000"/>

    </Setter.Value>

</Setter>

If we type an invalid value (e.g. 5) the Value property is updated, even if the InvalidValueBehavior is RevertValue.

We're using MVVM and binding, so this scenario updates the model with the invalid value, which causes all sorts of issues.

If these controls are to be used for binding in WPF (e.g. MVVM) then the Value property must only be updated if it passes the ValueConstraint.

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello ifdef,

    Thank you for your post!

    I have been investigating this issue, and this does appear to be an issue with the control. There is a workaround to this issue though, in that you can set the UpdateSourceTrigger of your Value binding to LostFocus. This will validate and (if the value passes the ValueConstraint) commit the value of the XamNumericInput after you leave edit mode.

    This is unexpected behavior of the control, though, and as such I have asked our engineering staff to examine this further. To ensure that it receives attention, I have logged this behavior in our internal tracking system with a development ID of 201674. I have also created a private case for you on this matter so that you can follow this development issue. This case has an ID of CAS-157449-P7H8V7 and you can access it here: https://ko.infragistics.com/my-account/support-activity.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Children