RadLabel with AutoSize and HTML content clipping

6 posts, 1 answers
  1. Matt
    Matt avatar
    10 posts
    Member since:
    Jun 2008

    Posted 05 Oct 2010 Link to this post

    Hi,

    I have a RadLabel control, with the AutoSize property set to true, which contains some HTML text.

    I have noticed that the RadLabel does not resize correctly. It resizes to the height necessary to display the plain text, so the HTML text is clipped.

    The text I am using for my test example is:

    "<html><p>Here is some question text.</p><p><strong>SOME VERY IMPORTANT NOTES.</strong></p><p>Here is some more question text.</p><p><strong>AND SOME MORE VERY IMPORTANT NOTES.</strong></p></html>"

    Is this a known issue, and is there a work around?

    Thanks in advance.

    Matt.
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Oct 2010 Link to this post

    Hi Matt, 

    Even though it is rendering the string that you gave as HTML, the <p> tag from what I see is not supported. 
    See http://www.telerik.com/help/winforms/labelhtml-like_text_formatting.html

    If you replace your <p> tags with a <br> then it sizes correctly. (also replace the <strong> tag with <b>) 

    Me.RadLabel1.AutoSize = True
    Me.RadLabel1.Text = "<html>Here is some question text.<br><b>SOME VERY IMPORTANT NOTES.</b><br>Here is some more question text.<br><b>AND SOME MORE VERY IMPORTANT NOTES.</b>"


    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Matt
    Matt avatar
    10 posts
    Member since:
    Jun 2008

    Posted 05 Oct 2010 Link to this post

    Hi Richard,

    This works for single line breaks, but this looks messy with my live data (which is read from an XML file, and can contain quite long paragraphs).

    If I put two <br> tags together then I get the problem with the text clipping.

    Thanks,
    Matt.
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Oct 2010 Link to this post

    Hi Matt, 

    You could request it as a feature to support the <p> tag in the Feature Requests forum or as a support ticket. 

    EDIT: On build 914 - It works fine putting in multiple <br> tags

    Another way would be to set the minimum size of the RadLabel control to the maximum height that you have and keep your <p> tags which seem to render as HTML

    richard
  6. Matt
    Matt avatar
    10 posts
    Member since:
    Jun 2008

    Posted 05 Oct 2010 Link to this post

    Hi Richard,

    Yes, this was fixed by installing build 914.

    Thanks for all your help.

    Matt.
  7. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 07 Oct 2010 Link to this post

    Hello Matt,

    Indeed, I confirm this issue. We will fix this in a future release. 

    As Richard pointed out, we have fixed the issue with the incorrect Label Sizing with double <br> tags in our latest Service Pack 2 released on Sep 14. So you could workaround the issue with placing double <br> tags. You can download this build from Your Account.

    Please, excuse us for the inconvenience. We have updated your Telerik points for the report.

    Kind regards,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready