Thank you for contacting us!
Unfortunately, you can’t copy тхе selection from one RadRichTextBox RadDocument instance to another because as in MS Word only the content of documents can be exported. Selecting functionality decorates the text, i.e. it is part of the document’s appearance in the control, not its content.
The main reason why Data providers (and XamlDataProvider in particular) are created is to suit for any scenario requiring XAML - only binding. A clear example of this is using RIA Services and the MVVM model for creating applications. You can decide which rich text providers is the best to your binding data. This way you are able to copy the content of the document with all of its styles. Please take a look at this article
regarding binding the provider to other UI Elements.
Additionally, if you choose to bind a data provider to a property in your view model, you can always create a new RadDocument instance from the property, modify the document using RadDocumentEditor
and preserve it back in the same property all without using code-behind. For example, if you bind RadRichTextBox to a XamlData
property using XamlDataProvider, here is how you can modify the document from your view model.
XamlFormatProvider provider =
RadDocument document = provider.Import(XamlData);
RadDocumentEditor editor =
//modify document using editor...
.XamlData = provider.Export(editor.Document);
I hope this helps.
If you have any further questions, do not hesitate to contact us.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>