RadMaskedEditBox simple decimal

4 posts, 1 answers
  1. Jan Pfeffer
    Jan Pfeffer avatar
    55 posts
    Member since:
    Aug 2006

    Posted 30 Aug 2011 Link to this post

    Hey at Telerik

    I would like to know how i can set the RadMaskedEditBox to accept only a decimal number.

    I need the RadMaskedEditBox for coordinates and cannot limit the box to a specific number og digits before the seperator or after.

    The closest i can get is by setting the MaskType of the RadMaskedEditBox to 'Numeric' and the Mask to 'n'.

    As i see it 'n' and 'n2' gives the same result. isn't 'n' supposed to not limit the input.

    Sincerly

    Jan
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 02 Sep 2011 Link to this post

    Hello Jan,

    Thank you for contacting us.

    The "n" mask by default requires two zeroes after the place holder, so yes "n" and "n2" does the same thing. For your scenario, the simplest mask that you can use in order to limit the number of digits before and after the place holder is the Standard mask:

    radMaskedEditBox1.MaskType = MaskType.Standard;
    radMaskedEditBox1.Mask = "##.####";

    The provided code limits to 2 digits before the place holder and 4 digits after it.

    I hope this helps. If you need further assistance, I will be glad to help.
     
    Regards,
    Stefan
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jan Pfeffer
    Jan Pfeffer avatar
    55 posts
    Member since:
    Aug 2006

    Posted 05 Sep 2011 Link to this post

    Hello Stefan

    What i need is not to limit the number of digits before or after the place holder.

    Compare it to a RadNumericTextBox  that has holds the datatype decimal from the ASP.NET control collection.

    Examples of values i must be able to support.
    1.7632632
    837.87
    3346.98372
    23.91237
    99782.9821
    1221.2312
    etc.

    Sincerly

    Jan
  5. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 07 Sep 2011 Link to this post

    Hi Jan,

    Thank you for writing me back.

    Currently, I am not able to provide you with a control that validates decimal number out of the box. However, this can be easily implemented with simple text box control. Please refer to the attached project, where you can observe such an implementation.

    Alternatively, you can use RadSpinEditor control, which supports decimal numbers. The only limitation is that you have to predefine the DecimalPlaces and if the user does not fill in enough decimal places the rest is filled with zeroes.

    Furthermore, we will consider improving the masks that RadMaskedEditBox provides, in order to achieve the desired functionality.

    I hope that you find this information useful. If you have any other questions, do not hesitate to contact us.

    Best wishes,
    Stefan
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top