Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeListMultiSelection.Add(TreeListNode) Method

Adds the specified node to the collection of selected nodes.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.2.dll

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

#Declaration

[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
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