private void menuItem_Click(object sender, EventArgs e)
        {
            TreeViewMenuItem menuItem = sender as TreeViewMenuItem;

            if (menuItem == null)
            {
                return;
            }

            switch (menuItem.Command)
            {
            case "Edit":
                EditNode();
                break;

            case "Expand":
            case "Collapse":
                ExpandNode();
                break;

            case "Add":
                AddNode();
                break;

            case "Delete":
                DeleteNode();
                break;
            }
        }
        public TreeViewDefaultContextMenu(RadTreeViewElement treeView)
        {
            this.treeView = treeView;

            this.editMenuItem = new TreeViewMenuItem("Edit", "&Edit");
            this.Items.Add(editMenuItem);

            this.expandCollapseMenuItem = new TreeViewMenuItem("Expand", TreeViewLocalizationProvider.CurrentProvider.GetLocalizedString(TreeViewStringId.ContextMenuExpand));
            this.Items.Add(expandCollapseMenuItem);

            this.addMenuItem = new TreeViewMenuItem("Add", "&Add");
            this.Items.Add(addMenuItem);

            this.deleteMenuItem = new TreeViewMenuItem("Delete", "&Delete");
            this.Items.Add(deleteMenuItem);

            for (int i = 0; i < this.Items.Count; i++)
            {
                this.Items[i].Click += menuItem_Click;
            }
        }
        private void menuItem_Click(object sender, EventArgs e)
        {
            TreeViewMenuItem treeViewMenuItem = sender as TreeViewMenuItem;

            if (treeViewMenuItem == null)
            {
                return;
            }
            switch (treeViewMenuItem.Command)
            {
            case "Edit":
                this.EditNode();
                break;

            case "Expand":
            case "Collapse":
                this.ExpandNode();
                break;

            case "Add":
                this.AddNode(this.treeView.CreateNewNode("New Node"), true, this.NodeUnderMouse);
                break;

            case "Delete":
                this.DeleteNode();
                break;

            case "Cut":
                this.CutNode();
                break;

            case "Copy":
                this.CopyNode(true);
                break;

            case "Paste":
                this.PasteNode();
                break;
            }
        }
 public TreeViewDefaultContextMenu(RadTreeViewElement treeView)
 {
     this.treeView     = treeView;
     this.editMenuItem = new TreeViewMenuItem("Edit", "&Edit");
     this.Items.Add((RadItem)this.editMenuItem);
     this.expandCollapseMenuItem = new TreeViewMenuItem("Expand", LocalizationProvider <TreeViewLocalizationProvider> .CurrentProvider.GetLocalizedString("ContextMenuExpand"));
     this.Items.Add((RadItem)this.expandCollapseMenuItem);
     this.addMenuItem = new TreeViewMenuItem("Add", "&Add");
     this.Items.Add((RadItem)this.addMenuItem);
     this.deleteMenuItem = new TreeViewMenuItem("Delete", "&Delete");
     this.Items.Add((RadItem)this.deleteMenuItem);
     this.cutMentuItem = new TreeViewMenuItem("Cut", "Cu&t");
     this.Items.Add((RadItem)this.cutMentuItem);
     this.copyMenuItem = new TreeViewMenuItem("Copy", "&Copy");
     this.Items.Add((RadItem)this.copyMenuItem);
     this.pasteMenuItem = new TreeViewMenuItem("Paste", "&Paste");
     this.Items.Add((RadItem)this.pasteMenuItem);
     for (int index = 0; index < this.Items.Count; ++index)
     {
         this.Items[index].Click += new EventHandler(this.menuItem_Click);
     }
 }