JsonNode Class
Defines a node in the JsonDataSource‘s schema.
Namespace: DevExpress.DataAccess.Json
Assembly: DevExpress.DataAccess.v22.1.dll
Declaration
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);
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the JsonNode class.
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.