This is a migrated thread and some comments may be shown as answers.

RadMaskedNumericInput bug with '.' on a Mac

2 Answers 15 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 16 Jan 2014, 01:47 AM
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 Answers, 1 is accepted

Sort by
0
danparker276
Top achievements
Rank 2
answered on 17 Jan 2014, 01:31 AM
Now I've also notices some errors when I type '0.' and whatever after that (Only on a mac)
0
Pavel R. Pavlov
Telerik team
answered on 20 Jan 2014, 02:20 PM
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 >>
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
danparker276
Top achievements
Rank 2
Answers by
danparker276
Top achievements
Rank 2
Pavel R. Pavlov
Telerik team
Share this question
or