This is a migrated thread and some comments may be shown as answers.

RadLabel with AutoSize and HTML content clipping

5 Answers 181 Views
Label
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 05 Oct 2010, 10:57 AM
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.

5 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 05 Oct 2010, 03:04 PM
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
0
Matt
Top achievements
Rank 1
answered on 05 Oct 2010, 03:25 PM
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.
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 05 Oct 2010, 03:34 PM
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
0
Matt
Top achievements
Rank 1
answered on 05 Oct 2010, 04:42 PM
Hi Richard,

Yes, this was fixed by installing build 914.

Thanks for all your help.

Matt.
0
Peter
Telerik team
answered on 07 Oct 2010, 05:34 PM
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
Tags
Label
Asked by
Matt
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Matt
Top achievements
Rank 1
Peter
Telerik team
Share this question
or