RadMaskedNumericInput with a leading decimal not behaving as expected

8 posts, 0 answers
  1. Alex
    Alex avatar
    17 posts
    Member since:
    Jan 2012

    Posted 22 Apr 2013 Link to this post

    Hello,

    I am using this control and am having negative feedback because users cannot type in .6 for example and get the control to display 0.6.
    Instead if you type .6 the control actually displays 6.0. Is there anything that can be done about this??

    Thanks.


    <RadMaskedNumericInput Value="{ Binding BgsPremiumRate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"  FormatString="n2" InputBehavior="Replace" Mask="" SelectionOnFocus="SelectAll"  TextMode"PlainText" />
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 25 Apr 2013 Link to this post

    Hi Alex,

     What stays behind this issue is that RadMaskedNumericInput should have a valid value in every moment and the valid values are:
    - null
    - double
    So practically "." means nothing and that is why it is not displayed in no-mask NumericInput. In a normal MaskedNumeric Input where Mask in not "", users can type "." then 6 which will produce 0.6 if the initial value is 0.0.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Alex
    Alex avatar
    17 posts
    Member since:
    Jan 2012

    Posted 25 Apr 2013 Link to this post

    Ok. The requirements for my textbox are:

    • No underline under the number (achieved by using a Mask="")
    • Any number of numbers to the right of the decimal place (not sure why this works, probably because there is no mask specified)
    • A defined number of numbers to the left of the decimal place (achieved with FormatString="n2")
    • .6 being treated as 0.6 (not currently working when Mask="")

    It seems having a Mask creates the the underlining issue, and having no Mask creates the .6 issue so I can't achieve what I need. Is there no way to meet all my requirements?

    Ironically all my requirements can be achieved with the standard WPF text box:

    <TextBox Text="{ Binding Age, Mode=TwoWay, UpdateSourceTrigger=LostFocus, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=n2}"  />


  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 29 Apr 2013 Link to this post

    Hi Alex,

    Since this TextBox's configuration works for you, you can consider using RadMaskedTextInput with Placeholder = " " (this will remove the underlining):

    <telerik:RadMaskedTextInput
                   Placeholder=" "
                   Text="{ Binding Age, Mode=TwoWay, UpdateSourceTrigger=LostFocus, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=n2}" />
    MaskedTextInput will give you power in validation scenarios, has built-in Clear Button and so on. Hope this is suitable for you.
    Having non-fixed number of digits after the decimal point in NumericInput is still a feature request in our PITS.

    Greetings,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Alex
    Alex avatar
    17 posts
    Member since:
    Jan 2012

    Posted 30 Apr 2013 Link to this post

    Hello,

    I'm now using the code below as you suggested. This doesn't restrict the number of digits after the decimal point to 2 as I thought it might and doesn't offer the comma formatting to illustrate thoudands. The RadMaskedNumericInput box is the closest I have come to providing what my client needs. Can I make a request for change to allow this box to accept .6 and then show 0.6 and not 6.0? Is there a request process for new features?
    <telerik:RadMaskedTextInput  IsClearButtonVisible="True" Text="{ Binding Age, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=n2}" Placeholder=" "  />
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 01 May 2013 Link to this post

    Hello Alex,

     I am little bit confused since you first needed this requirement:

    Any number of numbers to the right of the decimal place (not sure why this works, probably because there is no mask specified)

    but then you mentioned that the proposed settings do not restrict the numbers after the decimal point:

    This doesn't restrict the number of digits after the decimal point to 2.

    However, we created a PITS item for the requirement to process ".6" as 0.6 in NO-Mask Numeric input.
    You can track its status and vote for it, this way increasing its development priority.


    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Alex
    Alex avatar
    17 posts
    Member since:
    Jan 2012

    Posted 01 May 2013 Link to this post

    Uh, sorry. I got the left and right round the wrong way. I meant to say restrict the number of decimal places to the right and allow any number of numbers to the left. Anyway, if there is a request in the queue for this .6 being treated as 0.6 then my XAML is fine as it is.

    Out of interest what is the general turn around time for these requests?

    Thanks,

    Alex
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 06 May 2013 Link to this post

    Hi Alex,

     There is no typical time frame for our feature requests in PITS. However, the more votes they get the bigger is their development priority.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready