I have the following code generated by the designer
Infragistics.Win.UltraWinToolbars.RibbonTab ribbonTab1 = new Infragistics.Win.UltraWinToolbars.RibbonTab("ribbon1"); Infragistics.Win.UltraWinToolbars.RibbonGroup ribbonGroup1 = new Infragistics.Win.UltraWinToolbars.RibbonGroup("ribbonGroup1"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("New Page"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Save"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("New Page"); Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("Save");
ribbonTab1.Caption = "General"; ribbonGroup1.Caption = ""; ribbonGroup1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[ { buttonTool1, buttonTool2}); ribbonTab1.Groups.AddRange(new Infragistics.Win.UltraWinToolbars.RibbonGroup[ { ribbonGroup1}); this.ultraToolbarsManager1.Ribbon.NonInheritedRibbonTabs.AddRange(new Infragistics.Win.UltraWinToolbars.RibbonTab[ { ribbonTab1}); this.ultraToolbarsManager1.Ribbon.Visible = true; buttonTool3.SharedProps.Caption = "New Page"; buttonTool4.SharedProps.Caption = "Save"; this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[ { buttonTool3, buttonTool4});
There seems to be some redundency here with two buttons being created for each one I want. I tried remove buttonTool1 and 2, but then they disappear from the designer. Changing the values of 3 and 4 change what's displayed in the designer. Why are there 2 buttonTools for each button?
On the event side, I see that there is a toolClick event through the code. In the designer, I can only set events for the ribbon. Is there a way to set events for the individual tools through the designer?
Thanks.
-Nick
The redundancy you mention is due to how the toolbarmanager is structured. There is a concept of root tools and instance tools and would account for the duplicates. If you look at the following help article it will explain this concept in the "Root Tools and Instance Tools" section:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/WinToolbarsManager_Terms_and_Concepts.html
Also, there is one central event for the clicking of buttons on the toolbarmanager. You will want to have a switch statment based on the e.Tool.Key argument to control which action you wish to call.