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

HtmlDataProvider, RichTextBox, binding back to text

2 Answers 203 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
David Brenchley
Top achievements
Rank 1
David Brenchley asked on 25 Mar 2011, 06:10 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Ivailo Karamanolev
Telerik team
answered on 29 Mar 2011, 09:18 AM
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
0
David Brenchley
Top achievements
Rank 1
answered on 29 Mar 2011, 03:56 PM
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.
Tags
RichTextBox
Asked by
David Brenchley
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
David Brenchley
Top achievements
Rank 1
Share this question
or