Completed
Last Updated: 09 Sep 2016 11:48 by ADMIN
ADMIN
Dinko | Tech Support Engineer
Created on: 26 Apr 2016 08:31
Category: MaskedInput
Type: Bug Report
1
MaskedInput: Wrong position of the caret when you try to replace a char with the same one (InputBehavior="Replace")
Possible workaround:
You can subscribe to the PreviewTextInput event of the control and change the position of the caret if the typed char is the same as the current one.

private void RadMaskedTextInput_PreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            var input = sender as RadMaskedTextInput;
            var currentPosition = input.SelectionStart;

            if (currentPosition != input.Text.Length)
            {
                var currentChar = input.Text[currentPosition];

                if (currentChar != input.Placeholder && currentChar.ToString() == e.Text)
                {
                    input.SelectionStart++;
                }
            }
        }



Available in R3 2016 Release
0 comments