Add Node in Edit Mode with text

2 posts, 1 answers
  1. Davide
    Davide avatar
    5 posts
    Member since:
    Apr 2012

    Posted 18 Apr 2012 Link to this post

    Hi all  Telerik team,
       I would like  to add/edit  node and show the node text in the treeviewtextboxeditor as inizialized value , but the editor appear with empty text.

    I try to set value in the Valdiating event but this code ends the editing mode and user cannot modify the value
    void rtvCustomTags_Editing(object sender, Telerik.WinControls.UI.TreeNodeEditingEventArgs e)
        e.Editor.Value = e.Node.Text;

    can you help me, please?
    Thank you
  2. Answer
    Stefan avatar
    2908 posts

    Posted 21 Apr 2012 Link to this post

    Hello Davide,

    Thank you for writing.

    In order to set the node's text to its editor, you should use the EditorInitialized event of RadTreeView. Here is a sample code:
    public Form1()
        radTreeView1.AllowEdit = true;
        radTreeView1.EditorInitialized += new Telerik.WinControls.UI.TreeNodeEditorInitializedEventHandler(radTreeView1_EditorInitialized);
    void radTreeView1_EditorInitialized(object sender, Telerik.WinControls.UI.TreeNodeEditorInitializedEventArgs e)
        e.Editor.Value = e.Node.Text;

    I hope that you find this information useful.
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top