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

Manipulating RadDocument programmatically

2 Answers 446 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 09 May 2011, 02:46 PM
Hi there,

I'm busy evaluating the RadRichTextBox for our purposes and I've noticed that the InsertTable() method does not exist in the WPF version of the RadRichTextBox (vs SilverLight, which has the only documentation for this control).

I also noticed, regardless of it's existence in the API, that there is no way to specify a position for the table, regardless of where you might want to actually insert it in the document.

Could you please explain how, for example, I might programmatically insert a table into a RadDocument at a position which is in the middle of a paragraph?

The functionality I'm after is similar to how you would in a FlowDocument call InsertParagraphBreak() on a TextPointer and then insert the table in the Blocks section after the now preceeding Paragraph object.

2 Answers, 1 is accepted

Sort by
0
Accepted
Mike
Telerik team
answered on 12 May 2011, 12:28 PM
Hi Paul,

Actually the InsertTable method exists in both Silverlight and WPF APIs. Moreover both version of the product share nearly 100% of the code and API. I am also happy to inform you that we managed to roll out the online documentation for RadRichTextBox for WPF in a couple of weeks:
http://www.telerik.com/help/wpf/radrichtextbox-features-document-elements-tables.html

About the actual problem, please find attached a sample I prepared for  you, to demonstrate how you can insert a table at a specific position. In general the "Insert..." methods of RadRichTextBox respect the current Document.CaretPostion, which is similar to TextPointer in WPF. You can manipulate it using the methods of the DocumentPosition class:
http://www.telerik.com/help/wpf/radrichtextbox-features-positioning.html

Let us know if this helped.

All the best,

Mike
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
0
Paul
Top achievements
Rank 1
answered on 12 May 2011, 12:53 PM
Thanks, Mike. Just what I needed... I've marked your post as the answer.
Tags
RichTextBox
Asked by
Paul
Top achievements
Rank 1
Answers by
Mike
Telerik team
Paul
Top achievements
Rank 1
Share this question
or