Version

PasteNodes(UltraTreeNode) Method

Appends nodes from the clipboard to a parent node's Nodes collection.
Syntax
'Declaration
 
Public Overloads Function PasteNodes( _
   ByVal parentNode As UltraTreeNode _
) As Boolean
public bool PasteNodes( 
   UltraTreeNode parentNode
)

Parameters

parentNode
The node that will become the parent node for the pasted nodes.

Return Value

True if successful.
Remarks
If parentNode is null the nodes will be appended to the root Nodes collection.
Example
The following sample code shows how to cut, copy and paste nodes to/from the clipboard.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTree

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

    ' The following code will copy the selected 
    ' nodes to the clipboard
    Me.ultraTree1.CopySelectedNodes()

    ' The following code will cut the selected 
    ' nodes to the clipboard
    Me.ultraTree1.CutSelectedNodes()

    ' The following code will paste previous cut or
    ' copied nodes from the clipboard and append them
    ' to the ActiveNode's child Nodes collection.
    Me.ultraTree1.PasteNodes()

    ' The following code will paste previous cut or
    ' copied nodes from the clipboard and append them
    ' as root nodes.
    Me.ultraTree1.PasteNodes(Nothing)

    ' The following code will paste previous cut or
    ' copied nodes from the clipboard and append them
    ' to the specified node's child Nodes collection.
    Me.ultraTree1.PasteNodes(Me.ultraTree1.GetNodeByKey("node key 1"))

    ' The following code will paste previous cut or
    ' copied nodes from the clipboard and insert them
    ' as sibling nodes before the specified node.
    Me.ultraTree1.PasteNodes(Me.ultraTree1.GetNodeByKey("node key 1"), NodePosition.Previous)

    ' The following code will paste previous cut or
    ' copied nodes from the clipboard and insert them
    ' into the specified node's child Nodes collection.
    Me.ultraTree1.PasteNodes(Me.ultraTree1.GetNodeByKey("node key 1"), 3)

    ' Note: The above methods will all raise their corresponding
    '       "Before..." and "After..." events.

End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinTree;

private void button5_Click(object sender, System.EventArgs e)
{
	// The following code will copy the selected 
	// nodes to the clipboard
	this.ultraTree1.CopySelectedNodes();

	// The following code will cut the selected 
	// nodes to the clipboard
	this.ultraTree1.CutSelectedNodes();

	// The following code will paste previous cut or
	// copied nodes from the clipboard and append them
	// to the ActiveNode's child Nodes collection.
	this.ultraTree1.PasteNodes();

	// The following code will paste previous cut or
	// copied nodes from the clipboard and append them
	// as root nodes.
	this.ultraTree1.PasteNodes( null );

	// The following code will paste previous cut or
	// copied nodes from the clipboard and append them
	// to the specified node's child Nodes collection.
	this.ultraTree1.PasteNodes( this.ultraTree1.GetNodeByKey("node key 1") );

	// The following code will paste previous cut or
	// copied nodes from the clipboard and insert them
	// as sibling nodes before the specified node.
	this.ultraTree1.PasteNodes( this.ultraTree1.GetNodeByKey("node key 1"), NodePosition.Previous );

	// The following code will paste previous cut or
	// copied nodes from the clipboard and insert them
	// into the specified node's child Nodes collection.
	this.ultraTree1.PasteNodes( this.ultraTree1.GetNodeByKey("node key 1"), 3 );

	// Note: The above methods will all raise their corresponding
	//       "Before..." and "After..." events.
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also