This is a migrated thread and some comments may be shown as answers.

JSON from RESTful service to populate RadTreeView

1 Answer 250 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 06 Oct 2011, 10:17 PM
Hello,

I have a RESTful web service (url: http://www.example.com/foods.json) which returns JSON (list of foods). How do I configure the RadTreeView to pull the JSON data and build it's tree structure based on this data?

Example:

JSON =>

{ "Name":"Jalepeno", "Temp":"HOT" },
{ "Name":"Serano", "Temp":"HOT" },
{ "Name":"Bell Pepper", "Temp":"MILD" }
]

What I want my tree to look like =>
+HOT
|---Jalepeno
|---Serano
+MILD
|---Bell Pepper

Thanks!

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 11 Oct 2011, 02:40 PM
Hello Matthew,

I am sending you a sample demo that demonstrates one way to populate the tree from the JSON object.

Hope this will be helpful.

All the best,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
Matthew
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or