How to replace bookmark text

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    19 posts
    Member since:
    Nov 2010

    Posted 12 Sep 2011 Link to this post

    Hi there

    I want to use RichTextBox in confirmation dialog (using docx templates) and insert string and Images at corresponding bookmark position.

    foreach (BookmarkRangeStart bm in radRichTextBox1.Document.GetAllBookmarks())
    {
            switch (bm.Name) 
            {
               case 'OrderNo':
                  //how to replace only content of bookmark leaving formating and bookmark
                  break;
                ...
            }
    }

    Need help - thanks!
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 15 Sep 2011 Link to this post

    Hello Daniel,

    Please accept my apologies for the delayed answer.

    Please refer to this forum post which gives information about the Silverlight version of this control. The behavior of the WinForms version of RadRichTextBox control is the same.

    I hope this helps.

    Greetings,
    Julian Benkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Daniel
    Daniel avatar
    19 posts
    Member since:
    Nov 2010

    Posted 03 Oct 2011 Link to this post

    Hi Julian,
    thanks for the link to the silverlight version posting. The first sample which removes the bookmark after insert works correctly, but the second one destroyes my table layout - maybe it does not support tables yet?

    My suggestion is that Telerik adds a second parameter "collapse selection" to only include the inner content of the bookmark. 

    Selection.SelectAnnotationRange(bm, true)

    Would make usinging Bookmarks with RichextBox much easier.

    Regards, Daniel

  5. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 05 Oct 2011 Link to this post

    Hello Daniel,

    Currently, the control does not support this functionality. Table support for the WinForms version of RadRichTextBox control will be available for Q3 2011 release planned to be ready in the middle of the next month. 

    Thank you for the good API suggestion. We will try to include this method in one of our next releases.
    Your Telerik points have been updated.

    Kind regards,
    Julian Benkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top