Hi all
I have one webdatatree control inside the update panel .
i ave registered the node click event on page load using the following code
base
.OnInit(e);
wdtHomeTree.NodeClick +=
new DataTreeNodeClickEventHandler(OnSelectNode);
where onselectNode is a method having args as
protected void OnSelectNode(object sender, DataTreeNodeClickEventArgs e)
The method is not getting called at all.
Please guide how to proceed from here
Thanks
Saurabh
This saved my day! :)
BTW, if you don't mind, could you point me to the client side (Javascript) API documentation for this component?
Thanks!
Saurabh,
Once again I'll give the client side and server side. I'm assuming you mean the actual Value property of the node, not its text or address.
In your OnSelectNode server node click handler, you can get the node from e.Node. From there, you can get the node value as e.Node.Value.
If you had a client side node click handler, here is some sample code to get the value in the handler.
<script type="text/javascript"> function nodeClick(tree, args) { var node = args.getNode(); var value = node.get_valueString(); alert(value); } </script>
Just add <ClientEvents NodeClick="nodeClick" /> to the data tree.
Hopefully, this is what you're looking for.
regards,
Dave
I have defined tree like following
<ig1:WebDataTree ID="wdtHomeTree" runat="server" Width="99%" AnimationEquationType="Linear"EnableConnectorLines="True" AutoPostBackFlags-NodeClick="On" AutoPostBackFlags-SelectionChanged="On"SelectionType="Single" OnNodeClick="OnSelectNode" >
now its working, One more thing how to get the value of the selected node , i mean how to get that which node is clicked. i dint find any help on net :(
If you want to use the node click event on the server, you will need autopostback set to Async or On for node click. Depending upon what you are doing, you could also handle the node selection changed event as well in a similar fashion on the server. Or you could handle one or both of those similar events on the client instead. But set the autopostback flag for node click and let us know if that solves this problem for you.
Dave Young