This is a migrated thread and some comments may be shown as answers.

Go to Bookmark show on top of page

1 Answer 70 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
ANTONIO
Top achievements
Rank 1
ANTONIO asked on 05 Mar 2020, 05:51 PM

When I programmatically use go to bookmark on the richtexteditor the bookmark is shown on the editor in the bottom of the page is there a way to show on the top of the page?

I attached two pictures to explain batter the first one how the method gotobookmark is working and the second how i would like to be.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Vladislav
Telerik team
answered on 10 Mar 2020, 01:05 PM

Hello Antonio,

This is not something available right out of the box. I have logged this issue in our backlog: RadRichTextEditor: GoToBookmark does not reposition to top of the screen. You can vote for it and subscribe to the task by clicking the Follow button so you can receive updates about status changes.

Fortunately, the desired behavior can be achieved by scrolling to the end of the document (for example) and then go to the bookmark. Note that there should be enough content after the bookmark for it to appear at the top of the page. Here is some sample code to show how you can achieve that:

 

            if (this.radRichTextEditor1.RichTextBoxElement.ActiveEditorPresenter != null)
            {
                // This is faster than calling radRichTextBox.ScrollToVerticalOffset() as it does not automatically refresh the UI 
                this.radRichTextEditor1.RichTextBoxElement.ActiveEditorPresenter.ScrollToVerticalOffset(this.radRichTextEditor1.RichTextBoxElement.ActiveEditorPresenter.ScrollableHeight);
            }
            string bookmarkName = "Telerik";
            this.radRichTextEditor1.RichTextBoxElement.Document.GoToBookmark(bookmarkName);

I hope this information helps.

Regards,
Vladislav
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RichTextEditor
Asked by
ANTONIO
Top achievements
Rank 1
Answers by
Vladislav
Telerik team
Share this question
or