RadTreeView Node Text Formatting

2 posts, 0 answers
  1. Nate
    Nate avatar
    26 posts
    Member since:
    May 2011

    Posted 13 Jul 2011 Link to this post

    For the radtreeview I need to format the next for each node. I do not see a way to do this.
    If you can please expain how this is done.

    Thank you.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jul 2011 Link to this post

    Hello Nate,

    You can format the RadTreeView node by attaching the server side event onnodeedit. Here is the sample code that I tried which worked as expected.

    aspx:
    <telerik:RadTreeView ID="RadTreeView1"  AllowNodeEditing="true" runat="server" onnodeedit="RadTreeView1_NodeEdit">
       <Nodes>
          . . . . .
       </Nodes>
    </telerik:RadTreeNode>

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

    Thanks,
    Shinu.
Back to Top