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

How to replace bookmark text

3 Answers 185 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 12 Sep 2011, 10:25 AM
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!

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 15 Sep 2011, 12:38 PM
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 >>

0
Daniel
Top achievements
Rank 1
answered on 03 Oct 2011, 10:31 AM
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

0
Julian Benkov
Telerik team
answered on 05 Oct 2011, 11:23 AM
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 >>

Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Daniel
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or