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

2 posts, 0 answers
  1. Mohinder Goswami
    Mohinder Goswami avatar
    24 posts
    Member since:
    Nov 2008

    Posted 01 Jun 2012 Link to this post

    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.

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

    Posted 04 Jun 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top