RadMaskedNumericInput bug with '.' on a Mac

3 posts, 0 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 15 Jan 2014 Link to this post

    Say my mask is  Mask="#2.2" , On a Mac OS when I type .5  I get 5.00 instead of 0.5
    0.5 works but not .5

    I figured out this is because it's a PlatformKeyCode of 47 on mac vs 110 or 190 on a PC.

    To fix this I added this which works:

    public mainPage(){
    ...
    textBoxHours.AddHandler(RadMaskedNumericInput.KeyDownEvent, new KeyEventHandler(mask_KeyDown), true);
    }

    private
    void mask_KeyDown(object sender, KeyEventArgs e)
    {
        if ((e.Key == Key.Decimal) || (e.PlatformKeyCode == 190) || (e.PlatformKeyCode == 110) || (e.PlatformKeyCode == 47))
        {
            //47 is for mac
            RadMaskedNumericInput numericInput = sender as RadMaskedNumericInput;
            double value = numericInput.Value ?? 0.0;
     
     
            if (value == 0)
            {
                numericInput.Value = 0;
                numericInput.SelectionStart = 3;
            }
        }
    }

  2. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 16 Jan 2014 Link to this post

    Now I've also notices some errors when I type '0.' and whatever after that (Only on a mac)
  3. DevCraft banner
  4. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 20 Jan 2014 Link to this post

    Hi Dan,

    Unfortunately, you hit a bug in the RadMaskedInput control. It is already logged in our system and the best way to be notified for its resolution is to follow the item that I exposed for you in our Feedback portal.

    Please accept our apology for the inconvenience caused.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    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