Completed
Last Updated: 20 Jun 2023 04:56 by Jay
Release R2 2020 (LIB 2020.1.323)
Stuart
Created on: 28 Feb 2020 09:55
Category: UI for WinForms
Type: Bug Report
0
RadRichTextEditor: 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 RadRichTextEditor1_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
    if (e.Command is PasteCommand)
    {             
        Application.DoEvents();

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

 

Attached Files:
3 comments
Jay
Posted on: 20 Jun 2023 04:56
Nevermind. Responding to the wrong post.
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 20 Jun 2023 04:54

Hi, Jay,

The provided code snippet as a workaround is already in C#. Are you experiencing any difficulties with integrating this solution in your project?

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Jay
Posted on: 20 Jun 2023 04:50

Is there C# equivalent of this rocket science?