Welcome Guest Search | Active Topics | Sign In | Register

Context menu in TreeView Options
Maxim
Posted: Monday, January 5, 2009 7:41:48 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Hi.

How do I know which node is clicked (On Server Side), but not do select this node?

For exapmle: I select node on client side

function contextmenu_handler(e, control, item, cell) {
if (item != null) {
control.setSelectedNode(item, true);
var menu = eo_GetObject('<%=ContextMenuTreeView.ClientID %>');
var AddMenu = menu.searchItemsById("AddNewItem");
if (AddMenu.length > 0) {
var findMenu = AddMenu[0].getSubMenu();
if (findMenu) {
for (var i = 0; i < findMenu.getItemCount(); i++) {
var itemId = findMenu.getItemByIndex(i).getItemId();
if (itemId == item.getText()) {
findMenu.getItemByIndex(i).setVisible(false);
} else {
findMenu.getItemByIndex(i).setVisible(true);
}
}
}
}
eo_ShowContextMenu(e, '<%=ContextMenuTreeView.ClientID %>');
}
}

and on Server Side i write:

protected void ContextMenuTreeView_ItemClick(object sender, NavigationItemEventArgs e)
{
TreeNode node = TreeView.SelectedNode;
}

How it fix?

Thanks.
eo_support
Posted: Monday, January 5, 2009 7:49:58 AM
Rank: Administration
Groups: Administration

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

You would use TreeView.ContextNode instead of TreeView.SelectedNode.

Thanks!
Maxim
Posted: Monday, January 5, 2009 7:56:19 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
eo_support wrote:
Hi,

You would use TreeView.ContextNode instead of TreeView.SelectedNode.

Thanks!


great! 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.