Unplanned
Last Updated: 31 Oct 2018 08:13 by ADMIN
ADMIN
Todor
Created on: 09 May 2016 12:11
Category: RichTextBox
Type: Feature Request
0
RichTextBox: Change the viewport when the editor goes in header/footer edit mode in a way the header/footer gets into it
Scroll to the necessary value the vertical offset of the RadRichTextBox if header/footer is not in the viewport, but the editor goes into it.

Workaround: In the current implementation this could probably be achieved by using the ScrollToVerticalOffset method, but the calculations which should be done for the offset value might be not so straight-forward and easy to make. Here is a sample example of this:

this.radRichTextBox.ActiveDocumentEditorChanged += (s, e) =>
{
    if (e.DocumentEditorType == Telerik.Windows.Documents.UI.DocumentEditorType.Footer)
    {
        Section section = this.radRichTextBox.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection;

        double offset = this.radRichTextBox.VerticalOffset + (section.PageSize.Height - section.ActualPageMargin.Bottom) * this.radRichTextBox.ScaleFactor.Height;
        this.radRichTextBox.ScrollToVerticalOffset(offset);
    }
};
0 comments