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

4 posts, 0 answers
  1. LCJ
    LCJ avatar
    14 posts
    Member since:
    Nov 2007

    Posted 19 Jan 2009 Link to this post

    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?
  2. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 19 Jan 2009 Link to this post

    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.
  3. DevCraft banner
  4. LCJ
    LCJ avatar
    14 posts
    Member since:
    Nov 2007

    Posted 19 Jan 2009 Link to this post

    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.
  5. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 20 Jan 2009 Link to this post

    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.
Back to Top