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

Backspace in a RadMaskedCurrencyInput control behaviing badly

1 Answer 47 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 02 Sep 2015, 02:34 AM
I have identified a problem with the RadMaskedCurrencyInput controls handling of the backspace key.
I have set the following properties in code
 Mask = "";
 FormatString = "c";
 
The error scenario is
1. The control has the value "$0.00"
2. Place the cursor to the left of the period (between the '0' and the period).
3. Press the backspace key (The cursor ends up to the left of the left most '0')
4. Press the number '1' key to enter the value
 
Expected
The value in the control is "$1.00"
 
Actual
The value in the control is "$10.00"
 
At the moment this bug is preventing us from using the control. Is anyone able to provide a solution or workaround for this problem.
 
My client is running the latest version.
 

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 02 Sep 2015, 07:30 AM
Hi Mark,

You can use the PreviewKeyDown event handler like so:
private void RadMaskedCurrencyInput_PreviewKeyDown(object sender, KeyEventArgs e)
     {
         var input = sender as RadMaskedCurrencyInput;
         if (input == null)
             return;
 
         if (e.Key == Key.Back && input.Value < 10 && input.SelectionStart == 2)
         {
             e.Handled = true;
         }
     }
Please let us know if this fits well in your scenario.

Regards,
Petar Mladenov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Mark
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or