Unplanned
Last Updated: 21 May 2020 11:32 by ADMIN
Petar
Created on: 21 May 2020 11:31
Category: RichTextBox
Type: Bug Report
0
RichTextBox: Pasting text into the control does not scroll down to the caret position

Paste some text inside RadRichTextEditor. If the text has more rows than the currently visible area you will see that the control does not scroll down to the caret position.

Workaround:

 

private void RadRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
    if (e.Command is PasteCommand)
    {             
        Application.DoEvents();

        bool cursorAtDocEnd = this.radRichTextBox.Document.CaretPosition.IsPositionAtDocumentEnd;
        if (cursorAtDocEnd)
        {
            MoveCaretCommand command = new MoveCaretCommand(this.radRichTextBox.RichTextBoxElement);
            command.Execute(MoveCaretDirections.Down);
        }
    }
}

 

0 comments