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

DataBinding

4 Answers 90 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Pablo Tola
Top achievements
Rank 2
Pablo Tola asked on 07 Feb 2011, 09:05 PM
How to bind HTML to a viewmodel property?

4 Answers, 1 is accepted

Sort by
0
Pablo Tola
Top achievements
Rank 2
answered on 07 Feb 2011, 10:31 PM
I already solved this.

Thanks.
0
Iva Toteva
Telerik team
answered on 08 Feb 2011, 12:22 PM
Hello Pablo Tola,

 It is good to hear that you managed to resolve the issue yourself. If you have other questions, feel free to get back to us.

Kind regards,
Iva
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Paul Chan
Top achievements
Rank 1
answered on 19 Jul 2011, 04:44 PM
I am also interested in how to databind the HTML content of the RichTextBox to a ViewModel.  Also, how to get hold of the embedded bitmaps in a databinding scenario?  What is the recommended coding pattern?
0
Iva Toteva
Telerik team
answered on 22 Jul 2011, 01:35 PM
Hi Paul Chan,

RadRichTextBox uses data providers to bind the contents of its document to strings in different file formats. You can read more about data providers and the way they can be used in this article.
As for the images, you can use the customization options that the import and export settings provide. The examples in the article are about HtmlFormatProvider, but the settings can also be applied in a data-binding scenario, by accessing the format provider available as a property of the data provider, i.e.:

HtmlFormatProvider htmlFormatProvider = (HtmlFormatProvider)htmlDataProvider.FormatProvider;
htmlFormatProvider.ExportSettings = new HtmlExportSettings();
...

I hope this helps. Regards,
Iva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
RichTextBox
Asked by
Pablo Tola
Top achievements
Rank 2
Answers by
Pablo Tola
Top achievements
Rank 2
Iva Toteva
Telerik team
Paul Chan
Top achievements
Rank 1
Share this question
or