5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 19 Dec 2011, 05:15 AM
Hello,
Try the following code snippet to expand on node click.
CS:
Thanks,
Princy.
Try the following code snippet to expand on node click.
CS:
protected
void
RadTreeView1_NodeClick(
object
sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
RadTreeView1.SelectedNode.Expanded =
true
;
}
Thanks,
Princy.
0
Hi Richard,
I would recommend you rather add the method that populates the nodes to the click event. Here is the code that I added to our Load on demand Modes demo that worked at my side:
Hope this will be helpful.
All the best,
Plamen Zdravkov
the Telerik team
I would recommend you rather add the method that populates the nodes to the click event. Here is the code that I added to our Load on demand Modes demo that worked at my side:
protected
void
RadTreeView2_NodeClick(
object
sender, RadTreeNodeEventArgs e)
{
if
(e.Node.Nodes.Count == 0)
PopulateNodeOnDemand(e, TreeNodeExpandMode.ServerSide);
}
Hope this will be helpful.
All the best,
Plamen Zdravkov
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
0

richard
Top achievements
Rank 1
answered on 19 Dec 2011, 01:33 PM
Many thanks Plamen
I have tried your code snippet, but it does not seem to respond to a single click?
I am wondering do I need to assign it to an event in the ASPX file?
I have looked at your modes demo but this also only seams to respond to a double click.
Best Regards
Richard
I have tried your code snippet, but it does not seem to respond to a single click?
I am wondering do I need to assign it to an event in the ASPX file?
I have looked at your modes demo but this also only seams to respond to a double click.
Best Regards
Richard
0

richard
Top achievements
Rank 1
answered on 19 Dec 2011, 02:11 PM
Update:
I have tried allocating your snippet to OnNodeClick but this seems to trigger a complete postback and the whole page is refereshed, and the OnNode|Expand event is not fired at all.
I think somehow I need a client side click event that will somehow trigger the event assigned to OnNodeExpand
I have tried allocating your snippet to OnNodeClick but this seems to trigger a complete postback and the whole page is refereshed, and the OnNode|Expand event is not fired at all.
I think somehow I need a client side click event that will somehow trigger the event assigned to OnNodeExpand
0
Hi Richard,
You can try to use the onClientNodeClick event as in the code:
Hope this will help.
Kind regards,
Plamen Zdravkov
the Telerik team
You can try to use the onClientNodeClick event as in the code:
function
clientNodeClicked(sender, args){
args.get_node().set_expanded(
true
);
Hope this will help.
Kind regards,
Plamen Zdravkov
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