RadTree with Context Menu Error

2 posts, 0 answers
  1. Tamer Gamal
    Tamer Gamal avatar
    4 posts
    Member since:
    May 2010

    Posted 27 Nov 2010 Link to this post

    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
    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
    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);
      
    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);
                    }
                }
            }
    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);
                    }
                }
            }
                 if (treeNode.get_text() == ".") {
                        menuItem.set_enabled(false);
                    }
                    else {
                        menuItem.set_enabled(true);
                    }
                }
            }
    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);
      
    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);
                    }
                }
            }
                 }
                    else {
                        menuItem.set_enabled(true);
                    }
      
    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);
                    }
                }
            }
    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);
                    }
                }
            }
             }
            }
    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);
                    }
                }
            }
    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);
                    }
                }
            }
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 01 Dec 2010 Link to this post

    Hi Tamer Gamal,

    Could you, please, open a support ticket and send us a sample project or at least post the complete example here, so we can reproduce the issue?
    Thanks.


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top