Replace bookmark with table

2 posts, 0 answers
  1. Heiko
    Heiko avatar
    153 posts
    Member since:
    Oct 2012

    Posted 02 Mar 2013 Link to this post

    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.

  2. Petya
    Petya avatar
    990 posts

    Posted 06 Mar 2013 Link to this post

    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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top