Skip to main content

JsonNode Class

Defines a node in the JsonDataSource‘s schema.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v24.1.dll

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

Declaration

[TypeConverter(typeof(JsonNode.JsonNodeTypeConverter))]
public class JsonNode

Remarks

Use the JsonSchemaNode.Value property to access a JsonNode class instance and its members.

The following properties specify a JSON schema node:

  • Name - the node name.
  • DisplayName - the node’s display name.
  • Type - the data source field type.
  • NodeType - specifies if the node is an array, object, or property.
  • Selected - specifies whether to include the node in the JSON schema.

Example

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

using DevExpress.DataAccess.Json;
// ...
// 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)},
});
root.AddChildren(customers);

Inheritance

Object
JsonNode
See Also