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

Replace bookmark with table

1 Answer 38 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Heiko
Top achievements
Rank 1
Iron
Veteran
Heiko asked on 02 Mar 2013, 12:05 PM
Hi, I'm just starting with RichTextBox and Document API so this might be a simple rookie question.

What I have is a document containing a bookmark. I know how to find the bookmark and how to replace it with a string (as explained in the online help). What I want to do is insert a table at the bookmark position and just couldn't find a way how to do it. Please give me a hint as to how I can do that.

Regards
Neils

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 06 Mar 2013, 12:15 PM
Hi Neils,

In order to insert a table in a bookmark, you can create a DocumentFragment from the table and insert it in the manner demonstrated in the documentation. For this purpose you'd have to build a RadDocument from code that contains a table, build the document fragment and use the InsertFragment() method.

Please note that Table cannot be the first or last block in a RadDocument and you'd have to add empty paragraphs prior and after the table as done here.

I hope this helps!
 
Kind regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Heiko
Top achievements
Rank 1
Iron
Veteran
Answers by
Petya
Telerik team
Share this question
or