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

[Solved] Render HTML in Silverlight

4 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Manish Agarwal
Top achievements
Rank 1
Manish Agarwal asked on 20 Oct 2009, 01:21 PM
Hi

Is there any control available in Silverlight or RADControl which support HTML Rendering.
for example i have a data like :
string Ques=<UL><LI><STRONG><FONT size=5><FONT face="'Arial Black', Helvetica, sans-serif">ss</FONT>ddddd<FONT face="'Arial Black', Helvetica, sans-serif"></FONT></FONT></STRONG><LI><FONT face="'Arial Black', Helvetica, sans-serif"><B>ss</B></FONT> <LI><FONT face="'Arial Black', Helvetica, sans-serif"><B></B></FONT><LI><FONT face="'Arial Black', Helvetica, sans-serif"><B>ss</B></FONT></LI></UL>

i want to display this string in silverlight  "WrapPanel" ,currently i am using TextBlock to contain this string and then add my textblock to the Panel. But it is showing all these tags also.So which control should be used to display this kind of data . and please share some code as how to do this.
Please reply ASP

Thanks
Charu Pahuja

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Oct 2009, 01:24 PM
Hello,

You've missed RadHtmlPlaceholder.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Manish Agarwal
Top achievements
Rank 1
answered on 21 Oct 2009, 04:50 AM
Hi

Thanks for the reply but
how can we simply wrap text using RADHtmlPlaceHolder as we do for a textblock using "TextWrapping" property also
 2) how to set fontfamily of this textbox in codebehind.

for example i was using silverlight textblock

TextBlock txtText = new TextBlock();

 

 

txtText.TextWrapping =

TextWrapping.Wrap;

 

txtText.HorizontalAlignment =

HorizontalAlignment.Stretch;

 

txtText.VerticalAlignment =

VerticalAlignment.Stretch;

 

txtText. = FontWeights.Bold;

txtText.Text= questionTextWithPlaceholderValue;


i want to use this textblock like it can accept html values.So how can we apply "Bold" and "TextWrapping" property to RADHtmlPlaceHolder.

Please reply ASAP.

Regards
Charu
0
Valentin.Stoychev
Telerik team
answered on 21 Oct 2009, 07:53 AM
Hello Manish Agarwal,

You need to set a valid html, not xaml inside the html placeholder.

Please check this example source code for more info:
http://demos.telerik.com/silverlight/#HtmlPlaceholder/FirstLook

All the best,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Manish Agarwal
Top achievements
Rank 1
answered on 21 Oct 2009, 08:48 AM
Yes i am assigning valid html for this as i have given in my 1st post.

1)
But i also want to wrap my text without scrollbar in codebehind.
2)
 also i want to set the whole text as bold as i have mentioned in my last post
So can you please share some code with me..

Please reply soon.

Regards
Charu
Tags
General Discussions
Asked by
Manish Agarwal
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Manish Agarwal
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or