Special characters in node name OnNodeEdit

4 posts, 0 answers
  1. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 19 Mar 2014 Link to this post

    Hi,

    I need to display special characters in node name like "<",  " >". They display fine dynamically. But 'OnNodeEdit' as soon as I click 'enter', they change to "&lt;", "&gt;".
    Please help.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Mar 2014 in reply to Rob Link to this post

    Hi Rob,

    Please try the following code snippet which works fine at my end.

    ASPX:
    <telerik:RadTreeView ID="RadTreeView1" runat="server" AllowNodeEditing="True" OnNodeEdit="RadTreeView1_NodeEdit">
        <Nodes>
            <telerik:RadTreeNode Text="Books">
                <Nodes>
                    <telerik:RadTreeNode Text="Arts">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Biographies">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Children's Books">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Cooking">
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeNode>
        </Nodes>
    </telerik:RadTreeView>

    C#:
    protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e)
    {
        RadTreeNode nodeEdited = e.Node;
        string newText = e.Text;
        nodeEdited.Text = newText;
    }

    Let me know if you have any concern.
    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 20 Mar 2014 Link to this post

    Hi, Princy,
    Thank you for the quick response.
    This doesn't work for me, still having same issue.
  5. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 20 Mar 2014 Link to this post

    I've solved it.
    I was using Server.HtmlEncode when building the dynamic tree nodes.
    So I had to use:
    e.Node.Text = Server.HtmlDecode(e.Text);
Back to Top