This is a migrated thread and some comments may be shown as answers.

[Solved] Numeric box automatically changes value to max or min

2 Answers 134 Views
NumericBox for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Simon
Top achievements
Rank 1
Simon asked on 24 Sep 2013, 08:49 PM
The Numeric box automatically changes any value entered manually that is above the maxvalue to that maxvalue.  Same goes for any value entered below the minvalue.

Example: I have a numeric box with a maxvalue set to 1500.  User enters 1501 via the keyboard and moves on to another field, the value is automatically changed to 1500.  

I find this a poor way of implementing the min/max values by just auto changing the number since the user will likely not notice this change. Is there someway this can be dealt with better?  Perhaps throwing events like MaxValueExceed and MinValueExceeded and passing the actual value the user created, so that we can hook them up and do something more appropriate?

Even checking the ValueChanged event we cannot get the actual value the user entered, its already been changed to the min or max value.

Let me know if you have any suggestions, a workaround or can make changes to accommodate.

Thanks
Simon

2 Answers, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 24 Sep 2013, 08:55 PM
By the way, I also just noticed that it will also change the initial bound value if it also falls outside the min/max range.

Example. I have a numeric box with a min value of 3 and max value of 10.  This numeric box is bound to a property and its initial value is 1. The numeric box automatically changes it to 3 even though the data behind it is 1.  
0
Rosy Topchiyska
Telerik team
answered on 25 Sep 2013, 04:20 PM
Hello Simon,

Thank you for using RadControls for Windows 8!

By design you should not be able to enter values outside the allowed range in the RadNumericBox, otherwise it will be in invalid state. You are right that at this moment the RadNumericBox does not provide functionality for notifying that the entered value is outside the range. I have logged your request in our Ideas & Feedback Portal where you and our community can vote for it - the higher the demand, the higher the priority.

At this moment you can implement your own validation mechanism by setting the Minimum and Maximum of the RadNumericBox to double.Min/MaxValue and validate the entered value in the setter of the property in your view model, as well as when the ValueChanged event of the RadNumericBox is raised.

I hope this was useful and thank you for your valuable feedback!

Regards,

Rositsa Topchiyska
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
NumericBox for XAML
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Rosy Topchiyska
Telerik team
Share this question
or