How to create a context menu automatically

rated by 0 users
This post has 1 Reply | 2 Followers

Top 500 Contributor
Points 490
koolmike90 Posted: 12-30-2008 8:57 PM

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?

 

  • | Post Points: 20
Top 10 Contributor
Points 29,070
Infragistics Employee

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;

  • | Post Points: 5
Page 1 of 1 (2 items) | RSS

Forum Statistics

40,788 users have contributed to 129,818 threads and 144,150 posts.

In the past week, we've had 5,582 new users, adding to our total of 467,627 registered users!

In the past 24 hours, we have 56 new thread(s), 217 new post(s), and

In the past 3 days, the most popular thread for everyone has been "Google Chrome & UltraWebGrid. Compatible or Not? ". The post with the most views is "In wingrid RowFilter dropdown items for DropDown column is not shwing ". The most replies were made to "Google Chrome & UltraWebGrid. Compatible or Not? ".

Please welcome our newest member fceskxv .