Back to Devexpress

TreeListMultiSelection.Contains(TreeListNode) Method

windowsforms-devexpress-dot-xtratreelist-dot-treelistmultiselection-dot-contains-x28-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-x29.md

latest2.0 KB
Original Source

TreeListMultiSelection.Contains(TreeListNode) Method

Specifies whether a specific node is in the collection of selected nodes.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
public bool Contains(
    TreeListNode node
)
vb
Public Function Contains(
    node As TreeListNode
) As Boolean

Parameters

NameTypeDescription
nodeTreeListNode

The TreeListNode object to check.

|

Returns

TypeDescription
Boolean

true if a node is in the collection of selected nodes; otherwise, false

|

Remarks

The Contains method defines whether a specific node is selected.

Example

The code below determines whether the first node in the Tree List is selected.

csharp
bool firstIsSelected = treeList1.Selection.Contains(treeList1.Nodes[0]);
vb
Dim FirstIsSelected As Boolean = TreeList1.Selection.Contains(TreeList1.Nodes(0))

See Also

TreeListMultiSelection Class

TreeListMultiSelection Members

DevExpress.XtraTreeList Namespace