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

Node<T> Class

A base class that defines a node in a tree-like structure of objects.

Namespace: DevExpress.DataAccess

Assembly: DevExpress.DataAccess.v20.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.WindowsDesktop.DataAccess

Declaration

public class Node<T>

Type Parameters

Name Description
T

The node value type.

The following members return Node objects:

Remarks

The following Node<T> members define a node as part of a tree hierarchy:

  • Value - a T-type object that defines the node’s value.
  • Parent - the node’s immediate parent in a tree structure. null (Nothing in Visual Basic) if the node is located on a tree’s top level.
  • GetParents() - returns a list of the node’s parents up to the root level.
  • Children - a collection of nodes whose Parent is set to the current node.
  • AddChildren(Node<T>[]) - adds child nodes to the node.
  • AbandonChildren() - removes all child nodes from the node.
  • ForEach(Action<Node<T>>) - performs an action on the node’s each child node.

Declare a class that inherits Node<T> to implement an element of a tree structure:

using DevExpress.DataAccess;
// ...
public class TreeNodeValue {
  // Declare the node value members here.
}
public class MyTreeNode : Node<TreeNodeValue> {
  public MyTreeNode(TreeNodeValue value) : base(value) { 
    // Implement the node constructor logic here.
  }
}

The JsonSchemaNode class is based on Node<JsonNode> and defines nodes of the JsonDataSource‘s Schema. JsonNode contains properties that define the data source field that is created from the node of the JSON schema.

Inheritance

See Also