We allow users to customise the application ribbon. This is implemented using an UltraRibbonCustomisationProvider on the form, and some code to support saving and retrieving the configuration. To save the configuration we handle the CustomizationDialogClosed event, and use the UltraToolbarManager's SaveAsXml to write the settings to a stream which we then persist. To retrieve the configuration we handle the form load event, retrieve the XML config from the store, and use the UltraToolbarManager's LoadFromXml method to apply the customisations
Whilst this works fine for customsing the ribbon, we still have a bit of a problem. If we add a new tool to the application's main ribbon, it will often not appear on the user's ribbon, or appear in a strange place. They can resolve this by reseting the tab in the customisation dialog, or manually correcting the tool, but it's a bit of a pain handling the support that this leads to. Is there a better way to implement what we are trying to do? Something that would ensure tools that weren't present in the saved configuration are still visible on the ribbon after the configuration has been applied?
Hi Kevin,
The is an expected result of adding new tools between saving and loading layouts is that the new tools do not show after loading the old layout. Since those tools did not exist at the time the layout was created, the ToolbarsManager has no way to determine where they go, what toolbar (if any) they belong to, etc. This causes the tool to simply not show at all.
You mentioned that some of the new tools are appearing in strange places. This is NOT an expected result. What conditions cause this result? If you are able to reproduce this in a sample, please send it over and we will investigate. If you would prefer not to send your sample via the public forum, please let me know and I will create a private case to receive the sample.
My recommendation to address this is to add versioning information to your saved layouts. When you create a new version of your application with new tools and try to load an out-of-date layout, you can alert your users that the file is out of date and new tools will not show if they choose to proceed with loading it.
Finally, I recommend submitting a new product idea for this: http://ideas.infragistics.com/forums/192359-windows-forms. Please note that we will only be able to add a configurable default behavior to handle newly-added tools. Tools that cannot be tracked due to other changes in the application (for example, if a user moved a tool onto a toolbar that no longer exists) may still cause issues.