Infragistics2.Win.UltraWinTree.v8.1
Selected Property
See Also  Example
Infragistics.Win.UltraWinTree Namespace > UltraTreeNode Class : Selected Property

Gets/sets a value indicating whether the tree node is in the selected state.

Syntax

Visual Basic (Declaration) 
Public Overridable Property Selected As Boolean
C# 
public virtual bool Selected {get; set;}

Remarks

Setting the Selected state of a node will automatically update the UltraTree.SelectedNodes collection.

Example

The foolowing sample code toggles the selection state of the active node.

Visual BasicCopy Code
    Imports Infragistics.Win.UltraWinTree

    Private Sub button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button13.Click

        Dim node As UltraTreeNode

        node = Me.ultraTree1.ActiveNode

        If node Is Nothing Then Return

        ' Toggle the selected state of the active node.
        node.Selected = Not node.Selected

    End Sub
C#Copy Code
       using Infragistics.Win.UltraWinTree;

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

           UltraTreeNode node =
this.ultraTree1.ActiveNode;
       
           
if ( node == null )
               
return;

           
// Toggle the selected state of the active node.
           
node.Selected = !node.Selected;
       
       }

See Also