Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
855
Confused with Ribbon designer generated code and setting events through designer
posted

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