This is a migrated thread and some comments may be shown as answers.

why rename of radtreeview node is not allowing me to edit in the context menu?

1 Answer 61 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Suresh
Top achievements
Rank 1
Suresh asked on 02 Jun 2012, 12:05 AM
Hi,
i have provided the contextmenu for radtreeview node(new,edit,delete). on click of edit i had done in the below way

treeNode.startEdit();

in the oncontextmenuedit click, but is coming into the edit mode, immediately it is going into the normal non editable mode. what is the wrong i am doing?
thanks,
Mohinder Goswami.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Jun 2012, 05:45 AM
Hi Mohinder Goswami,

Try the following code snippet to achieve your scenario.

JS:
<script type="text/javascript">
    function OnClientContextMenuItemClicking(sender, args)
    {
        var menuItem = args.get_menuItem();
        var treeNode = args.get_node();
        menuItem.get_menu().hide();
        switch (menuItem.get_value())
        {
            case "edit":
                treeNode.startEdit();
                break;
        }
    }
</script>

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

Hope this helps.

Regards,
Shinu.
Tags
TreeView
Asked by
Suresh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or