MaskedNumericInput and MaskedCurrencyInput odd negative value behavior?

6 posts, 0 answers
  1. Rob Ainscough
    Rob Ainscough avatar
    188 posts
    Member since:
    Jan 2010

    Posted 05 Mar Link to this post

    When using either NumericInput (Mask="###0") or CurrencyInput (Mask="#4.2") with IsValidationHintVisible="False" and IsClearButtonVisible="False" and Placeholder=" " ... if I enter a negative value ... i.e. -1  or -10 the negative value can't be edited out by user input, highlight the entire content and Backspace or Delete and the negative symbol either "-" or "( )" remains in the input box.

    For an end user this becomes very difficult to work with ... so long as the user doesn't enter negative values, all is good, but as soon as they enter a negative value and the editing it out is difficult to impossible.

    Am I missing something, or is there some way to get these controls to work better with negative input that needs to be edited out.

    Thanks, Rob.

  2. Dinko
    Admin
    Dinko avatar
    462 posts

    Posted 08 Mar Link to this post

    Hi Rob Ainscough,

    Thank you for contacting us and for the provided information.

    We weren't able to reproduce this behavior using only the provided information. Basically, when we enter a negative value by pressing the minus Numpad key we were able to set or remove the "-" sign. Can you send us additional information about your mask set up? Have you bound the mask to a property from your view model? It will be great if you can send us isolated project from your application reproducing so we can further test it directly on our side.

    In addition, the mask which you have set to the NumericInput is invalid. If you want to place zero at the end of the input, you can escape it using the "\" backslash. In your case, the mask will look like this: Mask="###\0". You can take a look at the Mask Tokens help article in our documentation where the Mask property is further described.

    We are looking forward to your reply.

    Regards,
    Dinko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Rob Ainscough
    Rob Ainscough avatar
    188 posts
    Member since:
    Jan 2010

    Posted 08 Mar in reply to Dinko Link to this post

    Hi Dinko,

    Thanks for the response, unfortunately those Mask Tokens you pointed me to do NOT resolve my issue with negative values ... if I enter a negative value in a RadMaskedCurrencyInput I end up with "($, 1.00)" and it's impossible to remove the "(" or ")" ... these are bound to a Double in my MVVM.  The ONLY way to remove the negative values is to have IsClearButtonVisible=True, backspace or delete will not remove the "(" ")".  I typically have the IsClearButtonVisible=False as I don't want to us excessive screen real estate.

    Here is my sample xaml

    <telerik:RadMaskedCurrencyInput x:Name="RateTextBox" Grid.Column="1" Grid.Row="1" Value="{Binding Path=SizeRentRate, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" Mask="c4.2" TextMode="MaskedText" IsValidationHintVisible="False" IsClearButtonVisible="False" Placeholder=" " TextMode="PlainText" SelectionOnFocus="SelectAll" SpinMode="PositionAndValue" />

     

    Any suggestions?

    Cheers, Rob.

  4. Dinko
    Admin
    Dinko avatar
    462 posts

    Posted 13 Mar Link to this post

    Hi Rob Ainscough,

    Thank you for the additional information. Still, I wasn't able to reproduce it on my side using the latest version of our controls. Can you tell me which version of our controls have you referenced to your project? Also, can you try setting the AllowMinusOnZeroValues and AllowMinusOnNullValue attached properties to True? These properties control whether the minus sign ("-") in front of the zero (0 or 0.0) or null value can be visualized or not. You can read more about these properties and how to set them in the MaskedInputExtensions help article.

    For your convenience, I have attached the project which I use to test your scenario. Can you take a look at it and modified if I am missing some additional code.

    Regards,
    Dinko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Rob Ainscough
    Rob Ainscough avatar
    188 posts
    Member since:
    Jan 2010

    Posted 15 Mar in reply to Dinko Link to this post

    HI Dinko,

    We're using version 2017.1.206.1050.  

    Using the MaskedInputExtensions and setting AllowMinusOnZeroValues="False" and AllowMinusOnNullValue="False" ... I'm able to prevent input of negative values which prevents the situation from happening.  Fortunately I have no cases where users will need to input negative values ... but the behavior is still not correct when these properties are set to True.

    Cheers, Rob.

  6. Dinko
    Admin
    Dinko avatar
    462 posts

    Posted 20 Mar Link to this post

    Hello Rob Ainscough,

    Without reproducing this behavior on our side we can only guess what could be the reason behind this. Can you try modified the project from my last reply to reproduce it or create an isolated project from your application which reproduces this behavior? This way we can directly investigate it on our side.

    Regards,
    Dinko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top