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

JsonSchemaNode Class

Defines a node and its hierarchy in the JsonDataSource‘s schema.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v19.1.dll


public class JsonSchemaNode :

The following members accept/return JsonSchemaNode objects:

Library Related API Members
Cross-Platform Class Library DataSourceModel.JsonSchema
Reporting XtraReportModel.JsonSchema


A JsonDataSource‘s schema is a collection of JsonNode items. The JsonSchemaNode class specifies a node as part of the schema’s hierarchy:

  • The Parent property specifies the node’s immediate parent.
  • The GetParents() method returns a collection of parent nodes up to the schema’s root level.
  • The Children property stores a collection of the node’s children. The AddChildren(Node<T>[]) method appends nodes to the Children collection.
  • The AbandonChildren() method removes all children from the node.
  • The Selected property specifies whether to allow users to select the node or its children as data source fields.
  • The Value property contains a JsonNode class instance that defines the node’s additional properties.

You can specify a hierarchy of JsonSchemaNode in the JsonDataSource.Schema collection before you call the JsonDataSource.Fill method. If you do not specify the schema, JsonDataSource.Fill creates the data source schema and populates the data source with the data.


Set JsonDataSource.Schema to null before you call JsonDataSource.Fill to discard the previous schema changes.


The code sample below defines the JSON data source schema that consists of the Customer ID and CompanyName fields.

using DevExpress.DataAccess.Json;
using DevExpress.XtraReports.UI;
// ...
// Define the data source schema.
var root = new JsonSchemaNode();
root.NodeType = JsonNodeType.Object;
var customers = new JsonSchemaNode() { NodeType=JsonNodeType.Array, Name="Customers", Selected=true};
customers.AddChildren(new[] {
    new JsonSchemaNode(new JsonNode("ID", true, JsonNodeType.Property, typeof(string))) { DisplayName="Customer ID"},
    new JsonSchemaNode() { Name="CompanyName", Selected=true, NodeType=JsonNodeType.Property, Type=typeof(string)},

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the JsonSchemaNode class.


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