Skip to main content

Node<T> Class

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

Namespace: DevExpress.DataAccess

Assembly: DevExpress.DataAccess.v23.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap

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;
using DevExpress.DataAccess.Json;
// ...
// Create a new JSON source.
var jsonSource = new UriJsonSource() {
    Uri = new Uri(@"https://localhost:44367/api/values")
};
// Create the "X-Date" and "X-Id" header parameters that are added to the JSON URI requests.
jsonSource.HeaderParameters.AddRange(new[] {
    new HeaderParameter("X-Date", typeof(String), String.Format("{0:yyyy-MM-dd}", DateTime.Today)),
    // "ID" is a report parameter whose value is used for the "X-Id" header parameter.
    new HeaderParameter("X-Id", typeof(Expression), new Expression("?ID"))
});
// Assign the JSON source to the data source.
var datasource = new JsonDataSource() {
    JsonSource = jsonSource
};

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