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

hide expand/collapse image on root node

3 Answers 135 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 05 Jan 2012, 10:59 PM
i have a treeview. I'd like to hide the expand/collapse image on the root node. I tried the following:

function pageLoad()  
        {
            var treeView = $find("<%=TreeView1.ClientID%>");  
            var node = treeView.get_nodes().getNode(0);  
            var toggleElement = node.get_toggleElement();  
            if (toggleElement)  
            toggleElement.style.display = "none";
        }


and this works, however the tree nodes still have a large amount of space to their left where the expand/collpase image would have been. Is there any way to get the root node to left justify against the left edge of the treeview in this case?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Jan 2012, 05:35 AM
Hello,

To align the root node to left you can try setting the margin-left property in CSS.
CSS:
.rtIn
{
 margin-left: -10px !important;;
}

Thanks,
Princy.
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 06 Jan 2012, 06:40 PM
That moves the node text to the left. It doesn't move the node image to the left.
0
Kate
Telerik team
answered on 09 Jan 2012, 12:45 PM
Hi Albert,

In case you need the whole node to the left (the text and the image) you ca use the following css class selector:

div.RadTreeView .rtSp {
   margin-left: -15px;}

Regards,
Kate
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
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Princy
Top achievements
Rank 2
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Kate
Telerik team
Share this question
or