windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnodes-dot-add-x28-system-dot-object-x29-9ad8bab9.md
Adds a new child TreeListNode containing the specified values.
Namespace : DevExpress.XtraTreeList.Nodes
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
public TreeListNode Add(
params object[] nodeData
)
Public Function Add(
ParamArray nodeData As Object()
) As TreeListNode
| Name | Type | Description |
|---|---|---|
| nodeData | Object[] |
An array of values or a DataRow object, used to initialize the created node’s cells.
|
| Type | Description |
|---|---|
| TreeListNode |
The created TreeListNode object.
|
This method calls the TreeList.AppendNode(nodeData, ParentNode) method. The TreeListNodes.ParentNode property’s value is passed as the method’s second parameter. See the TreeList.AppendNode topic to learn more.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add(Object[]) 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.
winforms-treelist-copy-nodes-to-another-treelist/CS/CopyNodesExample/MainForm.cs#L44
object[] values = Enumerable.Range(0, columnCount).Select(x => sourceNode.GetValue(x)).ToArray();
var newNode = targetNodes.Add(values);
newNode.Assign(sourceNode);
winforms-treelist-copy-nodes-to-another-treelist/VB/CopyNodesExample/MainForm.vb#L47
Dim values As Object() = Enumerable.Range(0, columnCount).[Select](Function(x) sourceNode.GetValue(x)).ToArray()
Dim newNode = targetNodes.Add(values)
newNode.Assign(sourceNode)
See Also