If you right-click on an UltraTextEditor, a standard menu appears, allowing Undo, Cut, Copy, Paste, Delete, Select All.The functionality behind the selection made is automatically provided.
If you right click a node on an UltraTree, the node is highlighted automatically. Canthe UltraTree then have the same enu and automatic Copy functionality as the UltraTextEditor? If so, how do I enable it? If not, what is the command to copy the text of a selected tree node to the clipboard?
Many Thanks,
Kate
Is there any way to prevent that standard context menu from showing?
I don't think you can undo a cut, copy, or paste. You beleive you can undo cell edits using the PerformAction method.
In addition to above information provided, I want to add some:
We can cut, copy, paste selected nodes by simply using following methods provided for UltraTree,
CutSelectedNodes()
CopySelectedNodes()
PasteSelectedNodes(UltraNode node) //node on which to paste cut/copy nodes
I want to know how can i accomplish the Undo/Redo feature here???
private UltraTreeNode contextNode = null;private MenuItem menuItemCopy = null;
this.ultraTree1.MouseDown += new MouseEventHandler(ultraTree1_MouseDown);this.ultraTree1.ContextMenu = new ContextMenu();this.menuItemCopy = new MenuItem( "Copy", new EventHandler( this.OnMenuItemClick ) );this.ultraTree1.ContextMenu.MenuItems.Add( this.menuItemCopy );
private void ultraTree1_MouseDown(object sender, MouseEventArgs e){ UltraTree treeControl = sender as UltraTree; this.contextNode = treeControl.GetNodeFromPoint( e.Location ); this.menuItemCopy.Enabled = this.contextNode != null;}
private void OnMenuItemClick(object sender, EventArgs e){ MenuItem menuItem = sender as MenuItem;
if ( menuItem == this.menuItemCopy && this.contextNode != null ) Clipboard.SetText( this.contextNode.Text );}