I have an Office 2010 style ribbon. The application menu has a PopUpMenuTool with a ListTool on it (like the MRU list example). I'm trying to figure out how I can trap a right-click event on a ListToolItem so that I can display a custom context menu. Basically, I'm trying to emulate the behavior of MS Word 2013's "recent" document list where you can right-click on a document in the MRU list and see a menu of options.
Any suggestions?
Hello.
I'm pretty sure we can get this functionality working. Start off by setting the UltraToolbarsManager.Ribbon.ApplicationMenu2010.ShowDefaultContextMenu to True. This will allow the BeforeToolbarListDropdown event to fire when you right-click on a tool in the ApplicationMenu2010. Next, we will need to handle the event and see if we can get a ListToolItem from the context of the tool's UIElement:
Now just fill in the section with '// show custom context menu' comment with a call to display your own custom menu. Let me know if you have any questions. Chris
So I thought it was working... but the UIElement I get back from e.Tool.UIElement is always the first ListToolItem in my MRU list and not the one that was right-clicked. How do I get the UIElement of the ListToolItem that was actually right-clicked?
Worked perfectly. Thanks!