RadMaskedNumericInput showing only fixed length given in the Mask

4 posts, 0 answers
  1. Lakshmi
    Lakshmi avatar
    3 posts
    Member since:
    Apr 2012

    Posted 12 Dec 2013 Link to this post


    Hi, 
      
       I have been using the RadMaskedTextBox with MaskType "Numeric" and am getting an issue "Input string not in correct format" when following the below steps:

    1) Enter a number
    2) Modify the number to a negative value (-)
    3) Delete the number using BackSpace
     
      i.e., Exception thrown with negative symbols.

    As a workaround to this issue , telerik forums suggested to use RadMaskedNumericInput instead. But there comes another issue that I have to give fixed number of digits only in the Mask.

    My concerns are :-

    1) How to give the mask if the maximum number of numeric places is 18 and decimal digits as 2 ( say for eg., 123456789122345567.55)? 
    2) Is there any alternative other than giving mask?
    3) Can I give negative symbols as well ? If so, will it figure out the exception thrown with negative symbols.

    Please help to figure out this issue..

    Thanks
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Dec 2013 Link to this post

    Hello Lakshmi,

    I think you can use the following configuration:
    <telerik:RadMaskedNumericInput
               Mask=""
               FormatString="n2"
               maskedInput:MaskedInputExtensions.MaxTextLength="18"
               />
    where maskedInput namespace is:
    xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
    This will enable the following:
    • No underscores - because the Mask is "" (no-mask functionality)
    • 18 digits max on the left of the decimal place
    • group separators will show on the go while typing
    • FormatString n2 determines the number of digits on the right of the decimal symbol

    We hope this is exactly what you need.

    Regards,
    Petar Mladenov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Lakshmi
    Lakshmi avatar
    3 posts
    Member since:
    Apr 2012

    Posted 17 Dec 2013 Link to this post


      Thanks for your timely support.

    I have 2 more queries in this section:-

    1) Why the digits after decimal places not getting updated or inserted when we enter maximum number of digits( say 18) to the left of the decimal places.
    2) Also , how to replace the digits while entering similar to RadMaskedTextBox ?
    i.e., it is not replacing digits as we are entering instead we need to select the digits that we need to replace.


     Please help !!
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 20 Dec 2013 Link to this post

    Hello Lakshmi,

    MaskTextLength is mostly designed to work with RadMaskedTextInput and I have to admit that I have mislead you. In NumericInput it currently works the following way - if the Value is about to exceed the max text length you have set, the value changing is prevented. That is why typing a digit is not allowed - because inserting digit will make the Value bigger than 6 symbols. On the other hand, actual ReplaceMode does not work in No-Mask scenarios with MaxTextLength set - we will try to improve this behavior in some of our future releases.
    However, sice you need to use > 15 digits we want to suggest you to use the RadMaskedCurrencyInput which works with decimals. You can try the following setting:
    <telerik:RadMaskedCurrencyInput
                     Mask="#18.2"
                     AutoFillNumberGroupSeparators="False"
                     IsCurrencySymbolVisible="False"
                     Placeholder=" "/>
    Please let us know if this is suitable for you.

    Regards,
    Petar Mladenov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top