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.
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.
Hi Rob,
Thanks for the reply. But the Infragistics documentation states...
If the ValueConstraint object is associated with an editor's ValueConstraint property, Nullable indicates if the user is allowed to delete all the contents of the editor. If Nullable is set to False then the user is not allowed to delete all the contents.
Which makes most sense.
At present, a user can delete the number and the generic message "Input string was not in a correct format" is shown. This is not very user friendly.
I can see the discrepancy that you talk about in the docs versus what the control actually does. As such, I have logged a development issue for this so that our engineering staff can examine this further. The dev issue ID is 201618. I have also created a private support case for you so that I can link the dev issue to it. The case number is CAS-157378-Q8G0F0 and you can view it here.
Many thanks Rob.