This is a migrated thread and some comments may be shown as answers.

Can we "freeze" the context sub-menu?

3 Answers 52 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Irene
Top achievements
Rank 2
Irene asked on 25 Jul 2011, 08:30 PM
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

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Jul 2011, 06:04 PM
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.

0
Irene
Top achievements
Rank 2
answered on 28 Jul 2011, 08:37 PM
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
0
Plamen
Telerik team
answered on 29 Jul 2011, 02:43 PM
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.

Tags
TreeView
Asked by
Irene
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Irene
Top achievements
Rank 2
Share this question
or