Can anyone help me out with how we can set the controls for a single and double click eventson the nodes of the webtree. I want a single click to select the node and a double click to goto another page. Your hel will be gratly appreciated...
There is no node double click event for the tree. So there is no "out of the box" solution.
However what i did was to handle the single click event and store the last click time. If the event is raised within a particular time interval i interpret it as a double click. Be warned thoug, this will wreak havoc with the node edit feature. If you want to use that as well, you will have to play around with the infra js files. That can get a llittle complex.
Hope this helps.
Ahmad
Hello Ahmad,
This is a good idea. Ilike it, I can also suggest another alternative.
Unfortunately this event is not exposed server-side. However, there is one little trick that may work in your case. You can place a hidden button on the page, subscribe to its Click event and fire it with javascript from the TreeView DoubleClick client-side event. This way, the Button.Click event handler will be fired on node double click.
Example:
<asp:button runat="server" ID="Button1" OnClick="ClickEventHandler" style="position:absolute; top: -100px; left: -100px" />
...
// execute this from the client side double click event handler
var button = document.getElementById("<%= Button1.ClientID %>");
button.click();