HtmlDataProvider, RichTextBox, binding back to text

3 posts, 1 answers
  1. David Brenchley
    David  Brenchley avatar
    67 posts
    Member since:
    Jun 2010

    Posted 25 Mar 2011 Link to this post

    So far, I'm really liking the RichTextBox control.  I was wondering how to do this scenario.  I have a database table with 2 columns, summary and summary_unformatted.  I'm using the HtmlDataProvider to bind to the summary column where it saves to the column as HTML exactly as I want it.  I would also like to bind to the summary_unformatted column, but not as html, but straight text without the formatting.  How would I do this?  I would be doing this to make it easier to see the data when using query tools that don't display html correctly and for searching capabilities.
  2. Answer
    Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 29 Mar 2011 Link to this post

    Hello David Brenchley,

    The proper way to do this would be to establish another binding between a TxtDataProvider and the summary_unformatted property with OneWayToSource mode, but since this is missing from Silverlight, unfortunately, the only way to make this work reliably is to subscribe to the DocumentContentChanged event of the RadRichTextBox and using TxtFormatProvider, in code behind, update the desired property.

    All the best,
    Ivailo
    the Telerik team
  3. DevCraft banner
  4. David Brenchley
    David  Brenchley avatar
    67 posts
    Member since:
    Jun 2010

    Posted 29 Mar 2011 Link to this post

    Thank you,  that works.  I'm actually using this in WPF but couldn't find any documentation in wpf on the RichTextBox, only silverlight as yet, which is why I asked this in the silverlight forum.
Back to Top