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

RadRichTextBox

1 Answer 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chi
Top achievements
Rank 1
Chi asked on 12 Aug 2010, 09:50 PM
Hello

I am new to using telerik controls and need one question answered. Can someone please tell me how to programmatically retrieve the contents of the RichTextBox control as a simple string?

Also ther appears to be an exception when you call SetText with an empty String.

Thanks

1 Answer, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 13 Aug 2010, 09:13 AM
Hello Chi,

First of all, I'd recommend you to upgrade to the latest Q2 SP1 release if you haven't already done so. The SetText method was deprecated and instead of it you can use the TxtFormatProvider.Import(string input) method. It does work with string.Empty scenario. Also it has a very handy method to export a document to a string. Here's a snippet on how to do that:
string GetDocumentAsString(RadDocument document) {
    return new TxtFormatProvider().Export(document);
}
I hope this answers your questions. Let us know if you have any other.

Kind regards,
Ivailo
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
General Discussions
Asked by
Chi
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Share this question
or