Insert contect a wnd of Document

3 posts, 0 answers
  1. Dan
    Dan avatar
    16 posts
    Member since:
    Mar 2007

    Posted 02 Apr 2015 Link to this post


    I am investigating RadFlowDocument as a possible reporting tool. I can load a existing document and add content but I can`t find a way to insert my content at the end of the document.  What is the best way to navigate a document with RadFlowDocumentEditor?

    Thanks, Dan
  2. Tanya
    Tanya avatar
    583 posts

    Posted 03 Apr 2015 Link to this post

    Hi Daniel,

    The RadFlowDocumentEditor in fact does not support navigation, so it wouldn't be able to add text in the middle of a span for example. The editor maintains an internal position inside the document, which points either inside a paragraph (to an inline) or directly after the end of a table element. In order to change the position in the document you could use some of the RadFlowDocumentEditor's methods, which are listed in this help article.

    To insert content at the end of the document, you could find the last InlineBase element with the generic EnumerateChildrentOfType method and move the position using MoveToInlineEnd():
    InlineBase lastInline = editor.Document.EnumerateChildrenOfType<InlineBase>().Last();

    If you are trying to append several documents together you can also take advantage of the Merge() method.

    Hope this helps.


    See What's Next in App Development. Register for TelerikNEXT.

  3. Dan
    Dan avatar
    16 posts
    Member since:
    Mar 2007

    Posted 07 Apr 2015 in reply to Tanya Link to this post

    Thank you for the info on the Merge() method. Exactly what I was looking for.


Back to Top