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.
Thanks Mike. Pretty much what I suspected, just wanted to make sure I wasn't missing something that would help me handle it. I will submit a product idea for this - either configurable default behaviour, or an event/notification that it has happened would really help
With regards to the tool appearing in a strange place, this has only happened in one instance, but to several users. I've seen screenshots of the result but have been unable to reproduce it locally. I imagine there was something about their saved configuration that caused it, but we only keep the latest config per user, so I can't retrieve an example to test with. The specific case was previously a group of three state buttons. Default layout was small image, all three in a single column within a ribbon group, with the next tool in the group having the "Begin a group" setting checked. We added an additional state button, promoting one of the original to a large image to the left of the remaining three (two old/one new) buttons set to small image in a single vertical column
Do you happen to have any of those screenshots to share? It might help to see what goes wrong.
Hi Mike,
Dug out this one:
(URL: https://www.dropbox.com/s/qemuig07s2xlsrx/ribbon1.png?dl=0)
In the designer the tool shows where the user has drawn the arrow pointing to. Prior to this release "All Items" was the same size as "Hazardous" and "Reefer/Tanks" and above them (all three in single column)
Kevin
Thank you for sending your screenshot. Unfortunately, we were not able to determine much from it aside from confirming that the behavior should not be happening. In order to continue investigating this, the next step will be for us to look directly at the layout files. Is it possible for you to obtain a layout file from your users? Ideally, we would want to compare two layout files (one which does not exhibit the issue and one that does).
Would it be possible to obtain these files and provide them to us?
Sorry for the delay, been on vacation for a few weeks. Unfortunately all the users who experienced this have since reset the toolbar tab to correct the problem, and their layouts have been updated as a result. I've left a request that if anyone does see it they should give us time to extract their layout before correcting it, and will forward same if anyone gets back to us