Does RadRichtextBox convert the HTML tags in

2 posts, 0 answers
  1. Shiv
    Shiv avatar
    9 posts
    Member since:
    Apr 2012

    Posted 21 May 2012 Link to this post


    I'm working on radrichtext box and my application also allows the user to have basic html tags while entering the text..
    For example:

    This is for <b>testing</b>.  //using radrichtextbox

     <telerik:RadRichTextBox x:Name="BodyText" Grid.Row="1" HorizontalAlignment="Stretch" IsSpellCheckingEnabled="False"
                                        AcceptsReturn="True" VerticalScrollBarVisibility="Auto" >
                    <html:HtmlDataProvider x:Name="HtmlDataProvider" Html="{Binding Path=Body,Mode=TwoWay}" RichTextBox="{Binding ElementName=BodyText}" />

    I'm loading up the data from the  above richtextbox into  another radrichtextbox 
    And when I load up the text back into another radrichtextbox these tags should be parsed and the testing should be shown in bold. 

    The html text I'm getting is :

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns=""><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled</title><style type="text/css">
    .p_CC664AAA { margin: 0px 0px 12px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px; } 
    .s_1681A555 { font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 16px;color: #000000; } 
    .s_71516F31 { font-family: 'Times New Roman';font-style: Normal;font-weight: bold;font-size: 16px;color: #000000; } 
    </style></head><body><p class="p_CC664AAA"><span class="s_1681A555">dfhgsfdh </span><span class="s_71516F31">test</span></p><p class="p_CC664AAA"><span class="s_1681A555">&lt;p&gt;&lt;b&gt;This text is bold&lt;/b&gt;&lt;/p&gt;</span><span class="s_71516F31" /></p></body></html>

    The radrichtextbox is replacing the <> </> the tags with some other symbols(highlighted in bold).. Thus radrichtextbox is not able to convert while loading back. 

    Can we do this with radrichtextbox? 

    I'm using HTML dataprovider.
  2. Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 23 May 2012 Link to this post

    Hello Shiv,

    If you have the symbols "<", ">" as text in the editor, when you use HtmlFormatProvider or HtmlDataProvider to export the document, these characters will be escaped and will appear as &lt; and &gt; in the resulting HTML string. This ensures that the document will look correctly if viewed in a browser right away or imported back in the editor.

    Perhaps, at some point you have set the text of the editor to "<b>testing</b>" instead of using HtmlFormatProvider to import it and have it appear as testing. If you are not able to resolve the issue, we would appreciate a sample demo, so that we can see your implementation and advise you further.

    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top