Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > RadLabel with AutoSize and HTML content clipping

Answered RadLabel with AutoSize and HTML content clipping

Feed from this thread
  • Matt avatar

    Posted on Oct 5, 2010 (permalink)

    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.

    Reply

  • Posted on Oct 5, 2010 (permalink)

    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

    Reply

  • Matt avatar

    Posted on Oct 5, 2010 (permalink)

    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.

    Reply

  • Posted on Oct 5, 2010 (permalink)

    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

    Reply

  • Matt avatar

    Posted on Oct 5, 2010 (permalink)

    Hi Richard,

    Yes, this was fixed by installing build 914.

    Thanks for all your help.

    Matt.

    Reply

  • Peter Peter admin's avatar

    Posted on Oct 7, 2010 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > RadLabel with AutoSize and HTML content clipping
Related resources for "RadLabel with AutoSize and HTML content clipping"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]