Backspace in a RadMaskedCurrencyInput control behaviing badly

2 posts, 0 answers
  1. Mark
    Mark avatar
    1 posts
    Member since:
    Dec 2011

    Posted 01 Sep 2015 Link to this post

    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
    The value in the control is "$1.00"
    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.
  2. Petar Mladenov
    Petar Mladenov avatar
    2883 posts

    Posted 02 Sep 2015 Link to this post

    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)
             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.

    Petar Mladenov
    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
  3. DevCraft banner
Back to Top