Can we "freeze" the context sub-menu?

4 posts, 0 answers
  1. Irene
    Irene avatar
    18 posts
    Member since:
    May 2008

    Posted 25 Jul 2011 Link to this post

    Hello!

    I have a question:

    Can we configure multi-level context menu on a RadTreeeView to behave the following way:

    if user clicks on the selected item, which leads to another sub-menu, this sub-menu becomes visible and stays this way (usually all menus disappear when the user takes cursor off them).

    Thank you,

    Irene Troupansky

  2. Plamen
    Admin
    Plamen avatar
    2968 posts

    Posted 28 Jul 2011 Link to this post

    Hello Irene,

    You may try this code that we added to our Context menu Demo:
    <script type="text/javascript">
     
           //<!--
           //
           var closeFlag = false;
     
           function OnClientItemClosing(sender, args) {
     
               args.set_cancel(!closeFlag);
               closeFlag = false;
               //          
           }
     
           function onClientContextMenuShowing(sender, args) {
               var treeNode = args.get_node();
               treeNode.set_selected(true);
               //enable/disable menu items
               setMenuItemsState(args.get_menu().get_items(), treeNode);
           }
     
           function onClientContextMenuItemClicking(sender, args) {
               closeFlag = true;
               var menuItem = args.get_menuItem();
               var treeNode = args.get_node();

    Hope this is helpful.

    Kind regards,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start 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. Irene
    Irene avatar
    18 posts
    Member since:
    May 2008

    Posted 28 Jul 2011 Link to this post

    Thank you for the answer. I went to a demo code using link provided and i couldn't find niether OnClientItemClosing function nor where it is referenced, and the code in the message is incomplete. I also could not find OnClientItemClosing attribute in the TreeView. Could you please either update the Demo or past the whole aspx markup into the message. I will greatly appreciate it.

    Thanks,

    Irene
  4. Plamen
    Admin
    Plamen avatar
    2968 posts

    Posted 29 Jul 2011 Link to this post

    Hello Irene,

    I am sending you a working demo project that worked at my side.

    Greetings,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start 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.

Back to Top