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

Drop Expand/Collapse Image From Root Node

3 Answers 162 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 15 Jun 2009, 07:58 PM
Can anyone think of a way to drop the expand/collapse image from the root node of a tree view only so that the root item is sitting by itself without both the option to expand/collapse the tree and without the image which would do so.  I still want the expand/collapse image for all sub sections of the tree just not for when I have a root node which would literaly collapse the entire tree to nothing.

Any thoughts?
Andrew Nagel

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Jun 2009, 05:34 AM
Hi Andrew Nagel,

Try adding following javascript side code in client-side pageLoad() function as shown below.

JavaScript:
 
<script language="javascript" type="text/javascript"
function pageLoad() 
    var treeView = $find("<%=RadTreeView1.ClientID%>"); 
    var node = treeView.get_nodes().getNode(0); 
    var toggleElement = node.get_toggleElement(); 
    if (toggleElement) 
    toggleElement.style.display = "none";  
</script> 

-Shinu
0
Krishna
Top achievements
Rank 1
answered on 26 Sep 2014, 04:51 AM
<%=RadTreeView1.ClientID%>

Showing error Error 4 The name 'RadTreeView1' does not exist in the current context C:\Users\Xplore\Desktop\Checkboxlist\CheckBox.aspx 203
0
Hristo Valyavicharski
Telerik team
answered on 30 Sep 2014, 11:44 AM
Hi Krishna,

What if you replace <%=RadTreeView1.ClientID%> with <%# RadTreeView1.ClientID%>

Do you get the same error?




Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Krishna
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Share this question
or