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

Restrict numbers on entry (max 24, only .25, .5, .75 for decimals)

3 Answers 88 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
LCJ
Top achievements
Rank 1
LCJ asked on 19 Jan 2009, 10:29 PM
Is there any way to restric the numbers that are allowed on entry.  Say I wanted to record hours and the max would be 24 while the min was 0.  I also only wanted to allow entry of quarter hours to 0, .25, .5, .75.  Is there any way I can do this with the numeric up/down control?

3 Answers, 1 is accepted

Sort by
0
Hristo Borisov
Telerik team
answered on 19 Jan 2009, 11:31 PM
Hi Leonardo,

Yes, you can easily do that, just set SmallChange property to 0.25 and Maximum to 1. Also, if you want to restrict the user from entering his own number, you can set IsEditable property to false. Moreover, if you want to clarify the number inside the numeric, you can also set any string value in the CustomUnit property which will appear after the number. You can use the following code snippet to achieve your goal. I hope this will solve your issues, and thank you for contacting us.

<RadNumericUpDown Value="0" SmallChange="0.25" Maximum="1" IsEditable="False" CustomUnit="hour" /> 


Kind regards,
Hristo Borisov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
LCJ
Top achievements
Rank 1
answered on 20 Jan 2009, 01:26 AM
Maximum=24 and SmallChange=.25 help.

Data entry is still quicker if you enter numbers and the decimal using the keyboard so I would prefer that to requiring mouse clicks.  The decimal does not seem to take when entering manually.

I think I might need to add something on change to the qtr/hr on exit or something.
0
Hristo Borisov
Telerik team
answered on 20 Jan 2009, 06:22 PM
Hi Leonardo,

What exactly do you try to achieve? Please give us a more comprehensive example and scenario so we can research the best option to suit your needs. Thank you for contacting us, feel free to share your opinions and recommendations at any time.

All the best,
Hristo Borisov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
NumericUpDown
Asked by
LCJ
Top achievements
Rank 1
Answers by
Hristo Borisov
Telerik team
LCJ
Top achievements
Rank 1
Share this question
or