Binding to an HTML property

2 posts, 0 answers
  1. Samuel
    Samuel avatar
    2 posts
    Member since:
    Aug 2012

    Posted 18 Jul 2017 Link to this post

    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.



  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    3466 posts

    Posted 20 Jul 2017 Link to this post

    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.

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