Hi,
I have an application with a UltraToolbarsManager which I use to have a ribbon-menu. A part of the menu must be populated dynamically, which used to work fine.
I added some Tools to my Ribbon as a test using the designer, which made my app to have a problem because of duplicated tools, which is correct. Then, I removed the tools again (select and press DEL), in the expectation that my code would work again, which it didn't!
After some seconds of debugging, I found out that the tools where removed from the ribbon-group, but that for each tool, another instance was created, which was put into the UltraToolbarsManager.Tools-Collection. And these tools weren't removed. Thus, I saw the designer-code: A complete mess!
Some questions came up:
Why does the designer must generate a second instance, when only the key is needed for the UltraToolbarsManager.Tools-Collection?
How can that be? And how can I get my Desinger.cs cleaned up!?
As far as I know, the WinForms-Controls don't need such a mess to work properly.
Thank you
Patrik
PS: The corresponding part of the Designer.cs looks like:
this.toolbar.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] { controlContainerTool2, labelTool2, labelTool6, labelTool7, labelTool8, labelTool9, labelTool10, buttonTool2, stateButtonTool2});
But I only have 2 Ribbon-Groups with 1 Tool (one Group is initially empty and gets filled later).
Hello,
Tools are always added to the WinToolbars main tools collection even though your adding them to a ribbon for example. They are not properly cleaned up because you can always use the same tool in another area. It's not deleted when you remove them in the designer. To manage all the tools, added or removed, you can click on the 'UltraToolbarsManager' component in the component tray with the right mouse button and choose 'Customize...' from the menu. Then please navigate to the 'Tools' tab and there you will see the 'Delete' button in the bottom below all the tools in the collection.
Let me know if you have any questions regarding this matter.