Completed
Last Updated: 20 Oct 2014 13:56 by ADMIN
ADMIN
Peter
Created on: 23 Apr 2013 08:14
Category: Editors
Type: Bug Report
2
FIX. RadMaskedEditBox - when deleting with backspace the caret goes before the decimal point when the MaskType is set to Numeric
Steps to reproduce:
Set MaskType to Numeric and Mask = "n2". Click into the field to deselect contents. Caret is at the end of the string. Backspace twice and the data entry caret now jumps to BEFORE the decimal point. 

Workaround:
this.RadMaskedEditBox.KeyPress += new KeyPressEventHandler(RadMaskedEditBox_KeyPress);
		}

        void RadMaskedEditBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            RadMaskedEditBox textBox = ((RadMaskedEditBox)sender);
            int selectionStart = textBox.SelectionStart;
            bool beforePoint = selectionStart - 2 >= 0 && textBox.Text[selectionStart - 2] == '.';

            if (e.KeyChar == 8 && beforePoint)
            {                
                NumericMaskTextBoxProvider numericProvider = (NumericMaskTextBoxProvider)textBox.MaskedEditBoxElement.Provider;
                numericProvider.KeyPress(sender, e);
                e.Handled = true;
                textBox.SelectionStart++;
            }
        }
0 comments