3 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 08 Dec 2009, 09:39 AM
Hallo Balaji Velasiri,
Try setting the font style from client side as shown below.
ASPX:
JavaScript:
-Shinu.
Try setting the font style from client side as shown below.
ASPX:
| <telerik:RadTreeView ID="RadTreeView1" OnClientNodeCollapsed="OnClientNodeCollapsed" OnClientNodeExpanded="OnClientNodeExpanded" |
| runat="server"> |
| <Nodes> |
| . . . |
| </Nodes> |
| </telerik:RadTreeView> |
JavaScript:
| <script type="text/javascript"> |
| function OnClientNodeExpanded(sender, args) { |
| args.get_node().get_textElement().style.fontSize = "20px"; // Set the font style |
| args.get_node().get_textElement().style.fontWeight = "bold"; // Set the fonf style |
| } |
| function OnClientNodeCollapsed(sender, args) { |
| args.get_node().get_textElement().style.fontSize = ""; // Reset the style |
| args.get_node().get_textElement().style.fontWeight = "normal"; // Reset the style |
| } |
| </script> |
-Shinu.
0
Balaji
Top achievements
Rank 1
answered on 08 Dec 2009, 10:22 AM
Hi Shinu,
Thanks for your reply.
And is there any chance to achive the same through tree view custom style sheet ?
Thanks,
Balaji Velasiri
Thanks for your reply.
And is there any chance to achive the same through tree view custom style sheet ?
Thanks,
Balaji Velasiri
0
Balaji
Top achievements
Rank 1
answered on 16 Dec 2009, 07:02 AM
Hi
I have used the above suggested code. And it is working fine if we expand the node using mouse.
But I am expanding tree view node from separate button click including the normal node expanding nature(on button click I am calling the script to expand the tree view node e.g: treeView.get_selectedNode().expand()). In this case the OnClientNodeExpanded, OnClientNodeCollapsed events are not firing.
Is there any way to fire the OnClientNodeExpanded, OnClientNodeCollapsed events even if we expand the tree view node using client side script ?
Thanks in advance,
Balaji Velasiri