Hi,i have a treeview that dynamically filled with nodes in code behind and attach the context menu for it in code behind as well
and when i clicked on the node an IFrame Loaded and the context menu item load an rad window created in the code behind ,first i faced an error about the viewstate that it not the same with the post back,i worked around by setting a root node "." and set the selected=true,but now when i click the context menu at the first time i got "Microsoft JScript runtime error: '_events' is null or not an object "
the only client event i use is the onClientContextMenuShowing
i hope you find me a solution for that ...Thank You
and when i clicked on the node an IFrame Loaded and the context menu item load an rad window created in the code behind ,first i faced an error about the viewstate that it not the same with the post back,i worked around by setting a root node "." and set the selected=true,but now when i click the context menu at the first time i got "Microsoft JScript runtime error: '_events' is null or not an object "
the only client event i use is the onClientContextMenuShowing
function onClientContextMenuShowing(sender, args) {
var treeNode = args.get_node();
treeNode.select();
//enable/disable menu items
setMenuItemsState(args.get_menu().get_items(), treeNode);
}
//this method disables the context menu items for the Root element
function setMenuItemsState(menuItems, treeNode) {
for (var i = 0; i < menuItems.get_count(); i++) {
var menuItem = menuItems.getItem(i);
if (treeNode.get_text() == ".") {
menuItem.set_enabled(false);
}
else {
menuItem.set_enabled(true);
}
}
}
i hope you find me a solution for that ...Thank You