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

How to remove '+' sign

6 Answers 99 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 18 Dec 2008, 07:46 AM
Hi,
    How to remove the '+' sign of the last node from the tree view .
I took the help of the existing online example but is it is not working for me .

With Thanks & Regards
Manoj

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 18 Dec 2008, 08:07 AM
Hi Manoj,

The required approach is demonstrated in our online examples. You need to set the ExpandMode of the last nodes to ClientSide and they will not have expand icons.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shinu
Top achievements
Rank 2
answered on 18 Dec 2008, 08:27 AM
Hi Manoj,

You can also try the following client side code to hide the '+' of the last node.

ASPX:
 <telerik:RadTreeView ID="RadTreeView1"   CheckBoxes="true" OnClientLoad="OnClientLoad" > 
         

JS:
<script type="text/javascript"
function OnClientLoad() 
var tree = $find("<%= RadTreeView1.ClientID %>"); 
var nodeCount=tree.get_nodes().get_count(); 
   for (var i=0; i<tree.get_nodes().get_count();i++)    
   {          
       var node = tree.get_nodes().getNode(i);        
       if(node.get_index()==nodeCount-1) 
       { 
         var toggleElement = node.get_toggleElement(); 
          if (toggleElement) 
          toggleElement.style.display = "none"
       } 
   } 
 
 
</script> 


Shinu.
0
Manoj
Top achievements
Rank 1
answered on 19 Dec 2008, 05:52 AM
Hi Shinu,
    This is not working . It is removing the '+' sign for the time when the tree view is loading , but when we expanding further it is still there .

With Thanks & Regards
Manoj
0
Manoj
Top achievements
Rank 1
answered on 23 Dec 2008, 03:49 PM
Hi,
    Can any body help me out .
With Thanks & Regards
Manoj
0
Atanas Korchev
Telerik team
answered on 23 Dec 2008, 03:56 PM
Hello Manoj,

As I have already told you setting the ExpandMode property of the node to ClientSide will hide any expand icons. This is demonstrated in our online demos. Please test your code whether you set the ExpandMode property of your innermost nodes to the correct value.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Peter
Telerik team
answered on 23 Dec 2008, 03:59 PM
Hello Manoj,

What Shinu suggested should work. You just need to go through all nodes of the treeview (shinu's code sample enumerates only the root nodes) using get_allNodes(). Here is a help topic which shows how to do this:
http://www.telerik.com/help/aspnet-ajax/tree_clientexpandingcollapsing.html


Kind regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Manoj
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Shinu
Top achievements
Rank 2
Manoj
Top achievements
Rank 1
Peter
Telerik team
Share this question
or