HTML Rendering control

18 posts, 0 answers
  1. sachin
    sachin avatar
    7 posts
    Member since:
    Nov 2008

    Posted 04 Dec 2008 Link to this post

    Hi

    I am working in a scenario where i want to convert HTML to Rich formatted text like in Resume or CV

    I am getting HTML from DB and storing it into a div tag

     

    var t = dgBottomGrid.SelectedItem.GetType();

     

     

    var s = (string)t.GetProperty("Body").GetValue(this.dgBottomGrid.SelectedItem, null);

     

    HtmlDocument doc = HtmlPage.Document;

    HtmlElement div = doc.GetElementById("htmlSample");
    div.SetAttribute("innerHTML", s);
     

    My div tag converts this to Rich Formatted Text
    But when i m going to put it into a plain textbox, then it is not displaying propery.

    Is there any idea how can i do this ?
    Is there any control by Telerik to Show Rich Formatted Text ?

    Regards,
    Sachin

  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 08 Dec 2008 Link to this post

    Hello sachin,

    Unfortunately, your requirement is currently impossible with the tools that Silverlight 2 provides. The TextBox control can display only plain text. The TextBlock control, however, can display formatted text, but is not editable and you cannot directly put HTML inside.

    We have plans to create a HtmlPlaceholder control in Q1 2009 which is scheduled for the end of February. It will be able to get and display any HTML. As for the editability, in Q1 we will be also releasing a CTP of RadEditor for Silverlight.

    Regards,
    Valeri Hristov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Anita
    Anita avatar
    6 posts
    Member since:
    Feb 2009

    Posted 18 Mar 2009 Link to this post

    What is the counterpart or equivalent of HTMlPlaceholder in ASP .net rad controls? Is there one?
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 19 Mar 2009 Link to this post

    Hello Anita,

    ASP.NET controls are rendering html by default - they do not need such a control. Do you have any suggestion?

    Greetings,
    Valentin.Stoychev
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Anita
    Anita avatar
    6 posts
    Member since:
    Feb 2009

    Posted 19 Mar 2009 Link to this post

    ummm...ok.
    Another request was our users want to copy paste html in radeditor for both asp.net and silverlight and want them to render as html in view mode? Is it possible? I tried copy pasting html and it showed html tags.
  6. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 19 Mar 2009 Link to this post

    Hello Anita,

    The CTP version of RadEditor for Silverlight does not support the scenario in which users paste HTML content in the editor and then that content is automatically rendered. However, RadEditor has a Html property which you can set with your own content, as well as a PasteHtml() method which pastes HTML content in the current place of the cursor. If there is popular demand for the scenario you describe we will certainly consider implementing it.

    Best wishes,
    Tihomir Petkov
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Anita
    Anita avatar
    6 posts
    Member since:
    Feb 2009

    Posted 19 Mar 2009 Link to this post

    So does tha mean, that once that propery is set, user can copy paste html in the radeditor for asp.net and view without html tags in view mode? (not programmatically) I have not used this editor much.
    IF so, that is exactly I will be looking for for radeditor in Silverlight. I am currently evaluating CTP version.

    Thanks!
  8. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 19 Mar 2009 Link to this post

    Hello Anita,

    I'm not sure I fully understand your request. Can you help me by clarifying it please?

    I can say that both ASP.NET and Silverglight versions of the RadEditor support copy/paste of html/text/image content. You can copy content from anywhere (web site, another text editor, etc) and to paste it inside our Silverlight editor. Then you can get the whole content of the editor and to display (view) that content by using the RadHtmlPlaceholder control - just like our demo is created here:
    http://demos.telerik.com/silverlight/#Editor/FirstLook

    Looking forward for your reply!

    All the best,
    Valentin.Stoychev
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Anita
    Anita avatar
    6 posts
    Member since:
    Feb 2009

    Posted 19 Mar 2009 Link to this post

    sure...what our users want to do is paste "<b>Anita</b>" in the eidtor and the plaxeholder sould return it bold.
    I tried it with radeditor for SL  and the placeholder just displayed the string "<b>Anita</b>".
  10. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 20 Mar 2009 Link to this post

    Hello Anita,

    I see now. The problem is that the text you are copiying is getting into the clipboard as text and then is pasted as text into the editor. If you copy the text as html and it is stored into the clipboard as html it will behave in editor and in html placeholder correclty.

    If you open the demos application and copy the text below:

    " DEMO TEXT - COPY and PASTE INTO THE DEMOS APPLICATION"

    you will see that the formatting is kept.

    If your requirement is to paste text that contains HTML tags and then display it correctly as HTML you should use a simple textbox and then to give the content of the textbox to be rendered with the HtmlPlaceholder. 

    Hope this helps!

    Best wishes,
    Valentin.Stoychev
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Anita
    Anita avatar
    6 posts
    Member since:
    Feb 2009

    Posted 20 Mar 2009 Link to this post

    Thanks for you help in understanding!
    I believe and correct if I am wrong, but ASP .net radeditor allows you to to write html in html mode and can render it correctly.
    SL editor misses that. When can we expect SL editor to work the same wasy as ASP .net one. It is highly needed as then we can provide users the same experience when switching between the two applications (.net and SL).

     

  12. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 20 Mar 2009 Link to this post

    Hi Anita,

    Yes - the asp.net editor has one more view - HTMLView which we still have not in our Silverlight editor. It is in our plans, but I can not stick with a specific date.

    Best wishes,
    Valentin.Stoychev
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  13. Anita
    Anita avatar
    6 posts
    Member since:
    Feb 2009

    Posted 20 Mar 2009 Link to this post

    Alright! Thanks!

    We will look forward to it.
  14. rhodmie sagum
    rhodmie sagum avatar
    8 posts
    Member since:
    Mar 2010

    Posted 03 Mar 2010 Link to this post

    Hi,

    Can you guys please list which controls of the RadEditor | HTMLEditor contain HTML tags which is not supported in Silverlight? Are these controls can be disable?

    We'd like to implement a way so that controls that produces unsupported tags in Silverlight is disabled in RadEditor, is this possible?

    Thanks,
  15. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 04 Mar 2010 Link to this post

    Hello rhodmie sagum,

    Can you clarify what do you mean? Basically none of the Html tags are supported in Silverlight, because SL is not using Html to render the content.

    Sincerely yours,
    Valentin.Stoychev
    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.
  16. rhodmie sagum
    rhodmie sagum avatar
    8 posts
    Member since:
    Mar 2010

    Posted 04 Mar 2010 Link to this post

    hi,

    Sorry for the confusion, what I mean is the MS HTML Textblock

    Thanks


  17. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 05 Mar 2010 Link to this post

    Hello rhodmie sagum,

    Here how all is working:
     - you input Html with the RadEditor - you can use any tools
     - the produced html is then displayed with the html placeholder, which uses the web browser to render the produced content.

    So in this case - there is not interaction with SL at all. Everything is handled from the browser html rendering engine.

    Greetings,
    Valentin.Stoychev
    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.
  18. rhodmie sagum
    rhodmie sagum avatar
    8 posts
    Member since:
    Mar 2010

    Posted 05 Mar 2010 Link to this post

    Hi,

    Thanks, that actually how our application does. Only, we save into database the html tags produced by RadEditor as string, which the MS HTML Textblock control calls via db queries.

    Anyway, we are now working on a validation to trap the said scenario based on the list provided by MS.

    Thank you very much
Back to Top