Render HTML in Silverlight

5 posts, 0 answers
  1. Manish Agarwal
    Manish Agarwal avatar
    44 posts
    Member since:
    Sep 2009

    Posted 20 Oct 2009 Link to this post

    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
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 20 Oct 2009 Link to this post

    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.
  3. Manish Agarwal
    Manish Agarwal avatar
    44 posts
    Member since:
    Sep 2009

    Posted 20 Oct 2009 Link to this post

    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
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 21 Oct 2009 Link to this post

    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.
  5. Manish Agarwal
    Manish Agarwal avatar
    44 posts
    Member since:
    Sep 2009

    Posted 21 Oct 2009 Link to this post

    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
Back to Top