Thread is closed for posting
2 posts, 0 answers
  1. Chi
    Chi avatar
    3 posts
    Member since:
    Feb 2007

    Posted 12 Aug 2010 Link to this post


    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.

  2. Ivailo Karamanolev
    Ivailo Karamanolev avatar
    276 posts

    Posted 13 Aug 2010 Link to this post

    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,
    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
Back to Top