Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Adding right-click ability and pop-up menu to a Treeview

I have a treeview created as an ASP object on my form, populated with many items hierarchically. I want to add a pop-up menu which will appear when a node is right-clicked and show related operations that could be done on this node.

Creating TreeView is no problem. I can also create a pop-up menu with javascript and styles. But the thing is that TreeView does not have onClick event. Most probable answer is onSelectedNodeChanged event bu when I right-click a node on TreeView the javascript code about the pop-up menu fires first and besides the right clik event -of course- does not fire the onSelectedNodeChanged event.

On such conditions I first have to select a node and then right click it.

How can I possibly overcome this problem? The problem is basically that I want to change the SelectedNode while ı am right-clicking and then run a javascript to show a pop-up menu.

Regards.
[930 byte] By [utkuozan] at [2007-11-11 10:07:06]
# 1 Re: Adding right-click ability and pop-up menu to a Treeview
See if this helps: http://www.codeproject.com/aspnet/ClientSideTreeView.asp
Phil Weber at 2007-11-11 23:12:08 >