Completed
Last Updated: 24 Nov 2014 15:01 by ADMIN
ADMIN
Dimitar
Created on: 20 Aug 2014 12:05
Category:
Type: Bug Report
1
FIX. RadRichTextBox - the Ctrl + Left combination moves the caret to the previous word beginning.
To reproduce:
- Press ctrl+left when the caret is positioned in the middle of the word. 
- You will notice that the caret is moved to the beginning of the previous word.

Workaround:
public class CustomInputBehavior : InputBehavior
{
    public CustomInputBehavior(DocumentView view) : base(view)
    {
    }

    protected override bool ProcessLeftKey(KeyEventArgs e)
    {
        RadDocument document = this.DocumentView.Document;
        if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
        {
            string pos = document.CaretPosition.ToString();
            int posInWord = Convert.ToInt32(pos.Substring(pos.IndexOf('@') + 1, 1));
            if (posInWord > 0)
            {
                document.CaretPosition.MoveToCurrentWordStart();
            }
            else
            {
                document.CaretPosition.MoveToPreviousWordStart();
            }
          
            return true;
        }
        return base.ProcessLeftKey(e);
    }
}

Resolution: 
This issue is addressed in the new version of the control - RadRichTextEditor. Please use the new control instead the RadRichTextBox. 
0 comments