Hi
I have an
UltraNumericEditor and I Set minimum value to 1 maximum 999
But it allows us to enter manually using key board a value like 0
which it should not allow us at all when min and max values are set
And I press tab its stuck there for ever, is there any solution to avoid entering zero when minimum value is 1
help is appreciated
thanks and regards
venugopal darur
Hi Matt,
Try getting the latest service release:
How to get the latest service release - Infragistics Community
If that doesn't help, I think you will need to upgrade. Or just go with the workaround you have.
Must be the version issue. Created a clean project with the same results. Version of the contriols I am currently using is 10.2.20102.1004.
Thanks,
Matt
Hi,
If MinValue and MaxValue are 1 and 10 respectively, and you are still able to leave the control with a value of "0", then something is wrong. Either you are using an old version of the controls that had a bug in it, or something in your code is incorrect - like perhaps you are re-setting the MinValue to something else. Or maybe you code is handling the Validating event and letting it go through.
I tried this out in a small sample project just to make sure it's working correctly, and it works just fine for me. I attached my sample here in case you want to try it for yourself.
I was able to leave the control with the 0 in place. I am also able to leave the control after deleting or backspacing the value. Checking on the leave event, the actual value of the control differs then what is being displayed. I ended up adding the following:
Private Sub uneOneThruTen_Leave(sender As System.Object, e As System.EventArgs) Handles uneOneThruTen.Leave
If (Not uneOneThruTen.Editor.IsValid) Then
uneOneThruTen.Value = 1
End If
End Sub
The MinValue does work and it will prevent you from leaving the control if the value you entered is not within the acceptable range.
The control cannot validate the entire value of the control on every keystroke, because it doesn't know what the user may type next. "0" is a perfectly valid character because the user could enter "01", for example.