Infragistics2.Win.UltraWinTree.v8.1
SelectedNodes Property
See Also  Example
Infragistics.Win.UltraWinTree Namespace > UltraTree Class : SelectedNodes Property

Gets a collection of UltraTreeNode objects that are currently selected in the UltraTree control.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property SelectedNodes As SelectedNodesCollection
C# 
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.

Visual BasicCopy Code
    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
C#Copy Code
       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.

       }

See Also