Skip to main content
A newer version of this page is available. .

TreeListMultiSelection.Add(TreeListNode) Method

Adds the specified node to the collection of selected nodes.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.2.dll

Declaration

[Browsable(false)]
public void Add(
    TreeListNode node
)

Parameters

Name Type Description
node TreeListNode

A TreeListNode object representing the node to be added.

Remarks

If the node is added to the collection it is selected. You can call the TreeListMultiSelection.AddRemove method to invert the selected state of a node. The TreeListMultiSelection.Remove method can be used to deselect a node. See the Node Selection topic for details.

Example

The following code demonstrates how to add the last root node to the collection of selected nodes. After the code is executed, the last root node is selected.

treeList1.BehaviorOptions |= BehaviorOptionsFlags.MultiSelect;
treeList1.Selection.Add(treeList1.Nodes.LastNode);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add(TreeListNode) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also