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
185
XamNumericEditor allows pasting out of range values
posted

Hello,

I'm using version 15.1 for the XamNumericEditor editor.
I want to limit the end user to enter a value between 1 and 400 in the editor.
The only problem occurs when the user pastes a value out of range. The editor still accepts the value and displays the out of range value.
Here's what I have for the editor:

<igEditors:XamNumericEditor Width="50"
SpinButtonDisplayMode="Always"
IsAlwaysInEditMode="True"
AlwaysValidate="True"
SpinIncrement="1"
DataMode="Raw"
Mask="{}{char:3:0-9}%"
PromptChar=""
InvalidValueBehavior="RevertValue"
ValueType="{x:Type sys:Int64}"
Value="{Binding ImageWidthTransform, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
>
<igEditors:XamNumericEditor.ValueConstraint>
<igEditors:ValueConstraint Nullable="False" MinInclusive="1" MaxInclusive="400" />
</igEditors:XamNumericEditor.ValueConstraint>
</igEditors:XamNumericEditor>

 

I used the property InvalidValueBehavior and set it to "RevertValue" because I want to revert the value if an invalid/out of range value gets pasted into the editor.
The value never gets reverted.
I also tried to set the mask to "number:1-400" instead of the ValueConstraint, but still the same result.

Though the editor disables the up/down arrows if the value reached the max/min value. Also, typing the value will limit it to max value of 400. But pasting the value will not be limited.

Any ideas?

Thanks