Limitations of HMTL rendering in RadRichTextBox

5 posts, 1 answers
  1. Ian
    Ian avatar
    5 posts
    Member since:
    Nov 2010

    Posted 08 Apr 2012 Link to this post

    I'm trying to craft some HTML that will be correctly rendered in a RadRichTextBox and will also be suitable for consumption in a few other places.  In general it is tabular data. It has been a somewhat trial-and-error process. I have hit two issues so far:

    1. Unless the column width is specified, the HTML table expands to fill the width of the RadRichTextBox control. The same html rendered in a browser renders it tight to the width of the contents of the cells.

    2. The body font family and size seem to be ignored within the table. The CSS formatting needs to be repeated within each table element.

    My questions are:
    a) Are the two items above bugs that might get fixed or are they "features"?
    b) Is there any more detailed information on the supported aspects of html and CSS beyond this page:
    http://www.telerik.com/help/silverlight/radrichtextbox-features-html-support.html  ?
    c) Is further support for html/CSS on the roadmap for this control?

    Comments from any users who've blazed this trail already would also be most welcome.

    Thanks,
    Ian
  2. Answer
    Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 09 Apr 2012 Link to this post

    Hello,

    Generally speaking, RadRichTextBox's aim is to behave more like Word and less like a browser when opening HTML. In this light, some HTML constructs may be treated differently when imported in the editor in comparison with the way they are shown in a browser. Our policy is to collect specific request for enhancements/fixes when our behavior differs significantly from that of Word, estimate them and schedule them on an individual basis.

    Regarding 1, it is an issue indeed, but it is not in the HTML support, but rather in our internal table layouting algorithm - it doesn't support what you see in the browsers/Word. Once we enhance it to support this, the HTML format provider will be modified accordingly, but I can't give you any timeline for this.

    About 2. & 2.a) - I'm not sure exactly what your scenario is. You can send us specific HTML+CSS, so we can investigate the cause of the incorrect behavior and schedule it for fixing.

    b) This article is the best documentation there is on HTML and CSS support. As they are complex standards, you can further test it with specific samples.
    c) Further support for HTML and CSS will be provided for new features, as they come out (if applicable). Fixes and enhancements will be considered depending on the clients' demand.

    I hope this answers your questions. Contact us if you have any other ones.

    Kind regards,
    Ivailo Karamanolev
    the Telerik team

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

  3. DevCraft banner
  4. Ian
    Ian avatar
    5 posts
    Member since:
    Nov 2010

    Posted 09 Apr 2012 Link to this post

    Ivalio,

    Thanks for the reply.

    With respect to #1 I have found that even an undefined width ( "td {width}" ) or a small width value in the CSS will get me that tight wrapping. Presumably setting it to a small and sensible value is safer.  That workaround is fine with me.

    Regarding #2, here is some html where the Georgia font familiy for the body does not carry though to the table:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"> 
    <head><title>The Title</title>
    <style type="text/css">
    body {font-family:Georgia; font-size:100%;}
    .sum {font-size:0.70em; margin-left:10px;}
    .nam {font-weight:bold;  font-size:1.3em;}
    .tabl {text-align:right; font-size: 80%; }
    th {font-weight:bold; }
    td {width:75px}
    .rl {text-align:left; }
    .note {font-size:60%;}
    </style></head>
    <body>
    <p class="nam">The top heading</h2>
    <p class="sum">Summary Info<br/>More info</p>
    <table class="tabl"><tr><th class="rl">Group*</th><th class="rl">Name</th>
    <th>Alpha</th><th>Beta</th><th>Gamma</th></tr>
    <tr><td class="rl">Group 1</td><td class="rl"> Bob</td><td>0.28</td><td>0.28</td><td>0.28</td></tr>
    <tr><td class="rl"></td><td class="rl"> Fred</td><td>0.21</td><td>0.21</td><td>0.21</td></tr>
    <tr><td class="rl">Group 2</td><td class="rl"> Jim</td><td>0.28</td><td>0.28</td><td>0.28</td></tr>
    <tr><td class="rl"></td><td class="rl"> Dave</td><td>0.28</td><td>0.28</td><td>0.28</td></tr>
    <tr><td class="rl">Group 3</td><td class="rl">Bill</td><td>0.41</td><td>0.41</td><td>0.41</td></tr>
    <tr><td class="rl"></td><td class="rl">Harry</td><td>0.28</td><td>0.28</td><td>0.28</td></tr>
    </table>
    <p class="note"><br/>*This is a footnote</p>
    </body></html>

    Thanks,
    Ian
  5. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 13 Apr 2012 Link to this post

    Hello,

    I am happy you were to find a workaround that works for you.
    However, regarding the second issue - I've just tried opening the HTML you gave us in the current online demos, with the Georgia font correctly being applied to the table contents. Can you please verify the issue?

    Kind regards,
    Ivailo Karamanolev
    the Telerik team

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

  6. Ian
    Ian avatar
    5 posts
    Member since:
    Nov 2010

    Posted 13 Apr 2012 Link to this post

    Ivailo,

    Thank you for trying that out. Of course, when I update to the latest version of the Telerik controls and Silverlight 5 developer tools,  the problem is resolved - even when I keep the target version at Silverlight 4.  Looking back it seems that it might be related to the bug fix "Applying font style to selected empty table cells threw a NullReference exception".

    Sorry to take your time on this. I'm now a diligent updater :-)

    --Ian
Back to Top
DevCraft banner