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

Insert contect a wnd of Document

2 Answers 116 Views
WordsProcessing
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 02 Apr 2015, 08:58 PM
Hello,

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 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 03 Apr 2015, 03:25 PM
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();
editor.MoveToInlineEnd(lastInline);

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

Hope this helps.

Regards,
Tanya
Telerik
 

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

 
0
Dan
Top achievements
Rank 1
answered on 07 Apr 2015, 07:40 PM

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

Dan

Tags
WordsProcessing
Asked by
Dan
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Dan
Top achievements
Rank 1
Share this question
or