Version

SelectedNodes Property

Gets a collection of UltraTreeNode objects that are currently selected in the UltraTree control.
Syntax
'Declaration
 
Public ReadOnly Property SelectedNodes As SelectedNodesCollection
public SelectedNodesCollection SelectedNodes {get;}
Remarks

This collection contains references to all selected nodes in the UltraTree. Adding a Node to this collection will select the node. Removing a node from this collection will deselect the node.

Any time a node is selected/deselected, either by user action or in code, it is automatically added/removed from the SelectedNodes collection.

Example
The following sample code illustrates some of the information available in the SelectionDragStart event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win.UltraWinTree

Private Sub ultraTree1_SelectionDragStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles ultraTree1.SelectionDragStart

    Dim tree As Infragistics.Win.UltraWinTree.UltraTree

    tree = sender

    ' Begin a DragDrop operation
    tree.DoDragDrop(tree.SelectedNodes, DragDropEffects.Move)

    ' Note: Refer to the 'UltraTree Drag and Drop VB' sample
    ' to see how drag/drop can be implemented.

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

private void ultraTree1_SelectionDragStart(object sender, System.EventArgs e)
{

	Infragistics.Win.UltraWinTree.UltraTree tree;
	
	tree = sender as Infragistics.Win.UltraWinTree.UltraTree;

	// Begin a DragDrop operation
	tree.DoDragDrop(tree.SelectedNodes, DragDropEffects.Move);

	// Note: Refer to the 'UltraTree Drag and Drop CS' sample
	// to see how drag/drop can be implemented.

}
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