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

How to Identify and Replace Document Content

1 Answer 149 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Jason Bove
Top achievements
Rank 1
Jason Bove asked on 27 Apr 2011, 11:05 PM
Hi,

I'd like to be able to insert content (like a table or image for example) during during the RichTextBox drop event. During the drop event, I'd like to tag it somehow so that at a later time I can identify the table or image and replace with new content.

I've considered using a Comment as a marker - but have some questions around this:

1.) Is this the best way to achieve this?
2.) I've been able to add the comment to the document, but don't understand how to access the content contained between the CommentRangeStart and CommentRangeEnd elements.


Thanks in advance!

Jason

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 03 May 2011, 02:50 PM
Hi Jason Bove,

The best approach would be to use Bookmarks. Please find attached a demo, illustrating how you can add images and text in Bookmarks when you drop them on a RadRichTextBox.
Then, you can use the GetBookmarks() method to find all Bookmarks or GetBookmarkByName(string name) to find a bookmark by its name.
You can also select bookmarks with the help of DocumentPositions, as shown in the demo.

Best wishes,
Iva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Jason Bove
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or