I am working on telerik treeview control and I want to display all the nodes that are parent in bold. The treeview is created dynamically as in the treeview is bound to a Sql Server database. How can I display the parent nodes in bold.
reply me at ur earliest
thanks
Asim Ali
1 Answer, 1 is accepted
0
Veronica
Telerik team
answered on 02 Apr 2010, 02:35 PM
Hello Asim Ali,
I'm posting the reply to your support ticket for community reference.
To be able to make root nodes bold use the Javascript function below. The key is in choosing which of the nodes is a root node. That is achieved by the get_level property. It is 0 when the node is root:
Copy Code
<script type="text/javascript">
functionpageLoad() {
vartree = $find("<%= RadTreeView1.ClientID %>");
varnodes = tree.get_allNodes();
for(vari = 0; i < nodes.length; i++) {
if(nodes[i].get_level() == 0)
{
nodes[i].set_cssClass("bold");
}
}
}
</script>
Here's the bold CssClass:
Copy Code
<style type="text/css">
.bold
{
font-weight:bold;
}
</style>
For the exception that you receive when binding the RadTreeView you may find in my project a sample Binding to SQLDataSource. If you still need help could you please attach your code so we can be able to help you.
Greetings,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.