Html in node's text - Q1 2012

9 posts, 0 answers
  1. Raphaël MANSUY
    Raphaël MANSUY avatar
    28 posts
    Member since:
    May 2005

    Posted 15 Feb 2012 Link to this post

    I've just installed Q1 2012 and I have a display problem with my treeviews. The html in node's text is displayed as is (see screenshot).
    I generate the treeviews in code:

    ...
    var title = String.Format(
    "Unclassified <span style='font-size:9px'>({0})</span>", nb);
    RadTreeNode unclassified = new RadTreeNode(title, "-2");
    ...

    What is the fastest fix?
  2. Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 16 Feb 2012 Link to this post

    Hello,

    Yes, since the Beta release of Q1 2012 the text of RadTreeNode is html encoded, since we had some issues previously with dangerous requests errors when using Load on Demand through web service or serverside callback.

    One possible workaround to this is to go through the nodes in the OnClientLoad event and set their innerHTML directly. Here's how you can do that:
    function clientLoad(sender) {
        var nodes = sender.get_allNodes();
        for (var i = 0; i < nodes.length; i++) {
            nodes[i].get_textElement().innerHTML = nodes[i].get_text();
        }
    }
     
    Regards,
    Bozhidar
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Raphaël MANSUY
    Raphaël MANSUY avatar
    28 posts
    Member since:
    May 2005

    Posted 16 Feb 2012 Link to this post

    It works, thanks!
  4. Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 17 Feb 2012 Link to this post

    Hello,

    An update on the subject. Please see the following forum topic:
    http://www.telerik.com/community/forums/aspnet-ajax/treeview/known-issues-and-breaking-changes.aspx 
     
    All the best,
    Bozhidar
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Ed
    Ed avatar
    124 posts
    Member since:
    Jan 2008

    Posted 27 Feb 2012 Link to this post

    Hi there,

    I have tried setting the EnableNodeTextHtmlEncoding property to false as per the forum topic but it has made no difference: the HTML in the text of my nodes is still encoded.  In fact, Visual Studio 2010 doesn't recognise EnableNodeTextHtmlEncoding as a property of the RadTreeView.

    Am I doing something wrong?  I am using version 2012.1.215.40.

    Thanks,

    Ed Graham
  6. Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 27 Feb 2012 Link to this post

    Hi Ed,

    Thank you for getting back to us.

    The property isn't included in the official Q1 release. To get it, you have to upgrade to the latest internal build. You can see how to do that in the following link:
    http://www.telerik.com/support/kb/aspnet-ajax/general/updating-radcontrols-for-asp-net-to-another-version-or-license.aspx 
     
    Greetings,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Ed
    Ed avatar
    124 posts
    Member since:
    Jan 2008

    Posted 28 Feb 2012 Link to this post

    Dear Bozhidar,

    Thank you for your speedy reply.  I have looked in our account but cannot see any available internal builds -- please see the attached screenshot for information.

    Best wishes,

    Ed Graham
  8. Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 29 Feb 2012 Link to this post

    Hello Ed,

    Thank you for getting back to us.

    Please excuse us for the misunderstanding. Due to some internal reasons, the uploading of the internal build was slightly delayed. However now it's available for download.
     
    Greetings,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  9. Ed
    Ed avatar
    124 posts
    Member since:
    Jan 2008

    Posted 29 Feb 2012 Link to this post

    Thanks -- it's working now.
Back to Top