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.ValueConstraint.Nullable not being honoured
posted

Hi Infragistics,

We have a XamNumericInput control with a ValueConstraint that is not nullable...

<ig:ValueConstraint ValidateAsType="Integer32" MinInclusive="1000" MaxInclusive="2000" Nullable="False"/>

Expected behaviour in this state (as per the documentation) is that the contents of the control (in edit mode) cannot be cleared.

That doesn't appear to be the case. Setting Nullable to False still allows the control to be cleared. We've replicated this behaviour on both a XamNumericInput and XamDateInput. I suspect the others as well.

Parents
No Data
Reply
  • 34510
    Offline posted

    Hi ifdef,

    The behavior you are seeing is expected.  The value in the editor is not validated against the ValueConstraint until the editor tries to exit edit mode.  If you delete the value and try to tab out you should see an error message displayed saying that the value cannot be null.

    If you want to keep the user from typing in an empty value during edit mode, you can handle the ValueChanged event and check if the value has been changed to null.  If so, set the value to a non null value.

Children