I have a ribbon in my application, now the items in the ribbon area has increased and because all of them shows images the total width of all the tool items has increased the Ribbon Tool. Because of this, some of the tool items in some groups became small in size (I think to fit into the available area). I want them to keep their original size and want an overflow indicator in the group so that when that overflow indicator is clicked, it shows those other items. I am not being able to do it, and needs your help.
It did not work, the tool still shows with small images and the group is not collapsing.
Hello,
Could you please try to set the 'MinimumSizeOnRibbon' property to Normal or Large for each tool. Like this:
tool.InstanceProps.MinimumSizeOnRibbon = RibbonToolSize.Normal;
The ToolbarsManager will try to show all the tools and if this is not possible (if it does not have enough room to do so), it will collapse the group. If this property is set to default, the ToolbarsManager will be able to 'shrink' the tools to fit in the space, since a minimum size is not set for each of them and eventually the group will not be collapsed.
If the issue you are experiencing still persists, I would need a sample(reproducing it), which you want to make working this way. I will be glad to assist you further on this matter.
This is how I am creating it: var tool = childMenuItem as ToolBase; if (tool == null) return childMenuItem; var ribbonTab = parentMenuItem as RibbonTab; var targetGroup = ribbonTab.Groups.Exists(tool.SharedProps.Category) ? ribbonTab.Groups[tool.SharedProps.Category] : ribbonTab.Groups.Add(tool.SharedProps.Category); and I added this line after the above code:
targetGroup.Settings.CanCollapse = Infragistics.Win.DefaultableBoolean.True;
So, here the parentMenuItem is the RibbonTab, and for each tool that I add, I first check if the group corresponding to that tool is present (I always set the SharedProps for the tool before calling this method), otherwise I add the group. Irrespective of it already present or not, I always set its Settings.CanCollapse to true.
I also tried to set the GroupSettings.CanCollpase to True for the ultraToolBarsManager from the designer but that also did not work.
Could you please attach a sample for me to review it. You could add it to your post through the Options tab(next to Compose) -> 'Add/Update'.
Thank you.
I checked the sample and I think what you are referring is the following line:
ribbonGroup2.Settings.CanCollapse = Infragistics.Win.DefaultableBoolean.False;
I tried to set it to true but it did not work, my tools are still showing as small and it did not collapse the group. I also tried to set the property mentioned by you in your earlier post for GroupSettings to true, but that also did not help. One thing to note here is that all my tools, groups, tabs etc. are created at run time. I read an xml file and based on data I create Tabs, Groups and Tools.