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

Manually adjust plus, minus and spinner icons

3 Answers 203 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
vandenbroele
Top achievements
Rank 1
vandenbroele asked on 24 Apr 2012, 03:23 PM
Hello

I have a simple ASP.net handler which returns objects via JSON.
I want to use RadTreeView to display nodes corresponding to it.

All works fine, except I cannot find a way to control the icons (plus, minus and spinner) manually.
My JSON objects contain a flag "hasChildren" and the JSON is only one level deep per request.

I can make requests, get child objects, add them to the telerik tree, recursive if needed, etcetera ... but I cannot find how to manually visualize this ajax/loading behaviour and the "hasChildren" flag.

I noticed that the ExpandMode property on a node is related to this.. however I think it is not an option since it is 0 by default = TreeNodeExpandMode.ClientSide

Any help?

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 27 Apr 2012, 02:46 PM
Hi,

 
It is not very clear what are you trying to achieve. I am attaching a sample web page where is shown one way how to initialize RadTreeView from some JSON. 

As for the plus and minus icons you can change them with the help of the following CSS classes: rtPlusrtMinus.

Hope this will be helpful.

Kind regards,
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.
0
vandenbroele
Top achievements
Rank 1
answered on 27 Apr 2012, 03:25 PM
The server returns only JSON objects with one level of depth at a time. The objects have a flag "hasChildren".

The problem is that the TreeView will not show the plus icon, because after the first request .. there literally are no children, anywhere.
My script requests the children of a node when clicked on .... and only thén the icon will appear.

Right now, I have solved it by adding a dummy node when the node/object has the "hasChildren" flag.
0
Plamen
Telerik team
answered on 01 May 2012, 09:47 AM
Hi,

RadTreeView does not have such property that takes care of adding and removing the plus/minus sign in a RadTreeNode so I will recommend you to continue using your workaround. Please excuse us for this limitation of our control.

Greetings,
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
vandenbroele
Top achievements
Rank 1
Answers by
Plamen
Telerik team
vandenbroele
Top achievements
Rank 1
Share this question
or