Completed
Last Updated: 22 Feb 2016 14:57 by ADMIN
ADMIN
Dimitar
Created on: 18 Sep 2013 09:59
Category: Editors
Type: Bug Report
0
FIX. RadMaskedEditBox - when there is separator character in the mask the caret position is not moved properly.
To reproduce:
- Add a blank mask to a form and set its Mask type to Standard.
- Set its mask to "###-##-##";
- Set its PromptChar to a single space.
- Now set the caret before the '-' and type a two digits (the first digit is overridden by the second because the caret is not moved properly). 

Workaround:
Subscribe to the following KeyDown event:
void box1_KeyDown(object sender, KeyEventArgs e)
{
    int caretPos = this.box1.MaskedEditBoxElement.TextBoxItem.SelectionStart;

    if ((e.KeyCode != Keys.Left && e.KeyCode != Keys.Right) && (e.KeyCode != Keys.Up && e.KeyCode != Keys.Down))
    {
        if (caretPos < box1.Text.Length && box1.Text[caretPos] == '-')
        {
            this.box1.MaskedEditBoxElement.TextBoxItem.SelectionStart++;
        }
    }
}
0 comments