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.