Welcome Guest Search | Active Topics | Sign In | Register

Problem with using a ContextMenu on Treeview Nodes Options
Mike Wynn
Posted: Wednesday, August 29, 2007 9:20:43 AM
Rank: Advanced Member
Groups: Member

Joined: 8/24/2007
Posts: 130
Hi,

I have a tree view that comprises of a number of different node types. I create a context menu programatically for each node type and add them to a place holder control. I handle the context menu item click event server side. This is all working fine. The problem I have is that I do not have any tree view node context in NavigationItemEventArgs when handling the menu click server side. I have tried to add this context information to the Value field of the menu items in the client side context menu handler, and although this is successful on the client side, it does not get carried across to the server side handler.

I am really stuck here. The only solution I can see is to create a different context menu for each treeview node, and this would be highly inefficient!

Regards
eo_support
Posted: Wednesday, August 29, 2007 9:27:23 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
Hi,

You should definitely use the TreeView client side context menu handler for obvious performance reason. There are various ways to carry information back to the server side. You can either use a hidden input element or our callback control. Either way you need to handle the context menu's ClientSideOnItemClick to set the value of the input element or calling eo_Callback.

Thanks
Mike Wynn
Posted: Thursday, August 30, 2007 1:25:34 AM
Rank: Advanced Member
Groups: Member

Joined: 8/24/2007
Posts: 130
Not sure I understand this correctly. If I use the context menu's ClientSideOnItemClick to set the value of the input element or calling eo_Callback, I don't seem to have the tree view node context at this point. It still doesn't get me out of the situation.

I can see, however, that this solution might work if I set the value of the input element in ClientSideOnContextMenu handler. I will give this a go.
eo_support
Posted: Thursday, August 30, 2007 6:32:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
Hi,

You can do it at either place. For example, you can save the tree view node context information in a global variable and then use it later inside the context menu's clientSideOnItemClick.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.