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

Binding to an HTML property

1 Answer 133 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Samuel
Top achievements
Rank 1
Samuel asked on 18 Jul 2017, 08:01 AM

I'd like to bind my RichTextEditor to a text property that contains HTML.  If I understand correctly, one needs to import the HTML into the RTE for it to show up as formatted text and then export it to turn it back into HTML.

I'm wondering whether anyone has used the Format() and Parse() methods of Winforms DataBiinding to accomplish this seamlessly?

Or is there perhaps a simpler way of binding to an HTML data source that's provided by this Control?

Thanks in advance.

 

Michael

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Jul 2017, 07:42 AM
Hello Michael, 

Thank you for writing.  

Currently, RadRichTextEditor internally uses HtmlFormatProvider or TxtFormatProvider when setting the Text property considering the content. If it contains "<html>", RadRichTextEditor uses HtmlFormatProvider to import the text. This allows you to use simple data binding. You can find attached a sample project where it is demonstrated how the RadTextBox.Text property is bound to RadRichTextEditor.Text property. The attached gif file illustrates the available functionality.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RichTextEditor
Asked by
Samuel
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or