Rich text containing images scrolling incorrectly.

2 posts, 0 answers
  1. Richard Ellis
    Richard Ellis avatar
    26 posts
    Member since:
    Mar 2010

    Posted 05 Dec 2012 Link to this post

    When a RichText document contains only an image (or the first item is an image) it is automatically scrolling to the bottom of the first image.  We had previously fixed this with the following code:

    DocumentChanged =>
                // Scroll to Top-left of new document
                Dispatcher.BeginInvoke(new Action(() =>

    After updating to a newer version of the Telerik Dlls this seems to have stopped working and the problem is back.  Anyone know how to stop this happening?

    Originally a support ticket:


    UPDATE:  After further investigation it seems this works fine for when a document is changed - but does not fix when the RichTextBox is in a RadWindow - and the Document is set in the Constructor of the RadWindow.  Is the DocumentChanged event not firing?  Or is the invocation not enough?  Help please.
  2. Petya
    Petya avatar
    990 posts

    Posted 10 Dec 2012 Link to this post

    Hi Richard,
    Indeed, when the first element in a document is a large image, the control gets scrolled to the caret position which is in the bottom-left corner of the image.
    I tested the case you mentioned in your update and you are right that the behavior is not as expected. If you set the Document property of the editor in the constructor the DocumentChanged event is actually raised twice. It looks like we use a dispatcher internally in our code and what you can do in order to prevent the document from scrolling is use a construction with two dispatchers as follows:
    Dispatcher.BeginInvoke(() =>
    Dispatcher.BeginInvoke(() =>
    Please try that and let us know how it goes.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top