Hello,
I used ContextMenuStrip and ToolStripMenuItem, but now I want to use the same thing in infragistics. I know it is by using ultraToolbarsManager, but I do not know how to do that.
This is how I want it to happen:
Create the context menu automatically, programmatically, and assign it to UltraDropDownButton. So when the UltraDropDownButton is clicked, this context menu is shown.
Is there any altenative way to show the DropDownButton menu?
Using a context menu is not the best way to show a menu in an UltraDropDownButton. Instead, define the popup menu on your toolbars manager. Then set the PopupItem on the UltraDropDownButton to the root menu:
PopupMenuTool menu = new PopupMenuTool( "Menu" );
ButtonTool button1 = new ButtonTool( "Button1" );button1.SharedProps.Caption = "Button 1";
ButtonTool button2 = new ButtonTool( "Button2" );button2.SharedProps.Caption = "Button 2";
this.ultraToolbarsManager1.Tools.AddRange( new ToolBase[ { menu, button1, button2 } );
menu.Tools.AddToolRange( new string[ { button1.Key, button2.Key } );
this.ultraDropDownButton1.PopupItem = menu;