Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Webdatatree node click click event not executing
posted

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

Parents
No Data
Reply
  • 33839
    Suggested Answer
    posted

    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

Children