Hi all,
I'm trying to build a file explorer with WebDataTree and WebDataMenu.The menu has a item with "open file", I'd like to get the value of the Selected node from WebDataTree and retrieve this value on server side.
My goal is to open the selected file on clicking on the Open File menu item.
Thank you
Hi,
the WebDataTree has server side property SelectedNodes. On the client side using javascript you could retrieve the selected nodes using tree.get_selectedNodes() which is an array of selected node objects.
You can store the file url in the .Value server side property of the Node object so that later you can use it to open the file on the serverside.
So I would do it to configure the web data menu autopostback flags on ItemClick to be On. When the user clicks on the Open file item. The page will postback and on the serverside you could access the WebDataTree.SelectedNodes in the ItemClick handler that you attached to the menu ItemClick serverside event. Then you can use the .Value filed of the Node object and open the file from the location.
Hope this helps.
Thanks,
Lubomir