To render the TreeView by using the DataSource, use the JSON data as shown in the following code. Then, map the attributes specified in the JSON DataSource to the corresponding properties in the TreeView fields.
You can see the demo of the TreeView control rendered by using the JSON object from the following link:
Person.Address.AddressLine1 = “1 Main Street”
Person.Phone = “802.111.2222”
A TreeView cannot be built as follows, directly with this object.
But, you can use a standardly serialized JSON object as follows to build a TreeView.
You have to convert or format the above object into the required JSON format for building a TreeView. Once the JSON data source is formed, map the attributes accordingly, and then the Tree is created with the proper structure. Refer to the following code to build a TreeView from a perfectly serialized JSON object.
The following screenshot displays the TreeView by using the DataSource:
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|