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.
Hello mayank_goyal,
If I understood your requirements right, the behavior you are trying to achieve is possible with the toolbars when the ribbon is hidden. When the ribbon is shown, the groups have two states of showing the tools inside them - all the tools could be visible or all the tools could be fitted in a GroupButton(if there is not enough space for the group to show all the tools, it collapses). The second behavior could be achieved by setting:
ultraToolbarsManager.Ribbon.GroupSettings.CanCollapse = Infragistics.Win.DefaultableBoolean.True;
For an illustrative example of the above said, you could check out the two samples called "WinToolbars Basic Features with the new Scenic Ribbon Style" and "IG Paint with Ribbon in new Scenic Ribbon Style".
These samples could be located in our 'Windows Forms Feature Browser'. If you have this installed(if you have marked 'Samples' when installing Net Advantage), you could run it from 'Start Menu' -> 'All Programs' -> 'Infragistics' -> 'Windows Forms' -> 'Samples' -> 'Samples (local)'. These samples are under the 'Commands and Editors' tab. Another easy method to find them is by typing their names in the 'Search:' field.
Please feel free to let me know if I misunderstood you or if you have any other questions.
I think I tried this but it did not collapse the complete group, but just made some of the tools smaller in size. I will try it again, the other thing is my Ribbon Style is Office 2010 and not Scenic
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.
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.
It did not work, the tool still shows with small images and the group is not collapsing.
I think, if I understood you right, of course, that my sample reproduces the behavior you are after. If it does not, please inform me. Another thing that could keep you from achieving what you want, might be setting different sizes of the tools or of the images. I will be very glad to assist you further on that matter, so please do not hesitate to contact me again regarding any questions that you have.
it did not work for me from the samples, can you please post some code that I can refer. When you say that "different tools might be setting different sizes" do u mean that all the tools in the Ribbon or group should be of the same size (Width).
Thank you for your feedback, I am very glad that you got it working.
Please do not hesitate to contact us if you need any additional assistance.
I could finally get it working. It works only if you set the MinimumSizeOnRibbon to Large and not if that is set to Medium.
The tools have to be of the same size if you want them not to shrink in order to fit in the area. I feel that I misunderstood you here. So let us clear this out please - If there is not enough space for the ribbon to show all the tools, they should be placed in the collapsed group and not to shrink(not any of them). If that is the case I believe that my sample demonstrates this. If you expect another behavior please let me know, I will be happy to assist you further on that matter.