0

In an Excel 2010 Addin we programmatically populate a multi-level RibbonMenu with items from a database. However, it seems impossible to display a RibbonMenu having more than five levels. (Some) Clients get a runtime exception stating that a maximum of only 5 nest levels is supported (verbatim: "Maximal 5 geschachtelte Menüs sind zulässig."). After dismissing the dialog window, the menu shows and is functional, but any menu items deeper than five levels are missing and some items on levels <= 5 are disabled (e.g. RibbonMenus missing their level-5-RibbonButtons).

It doesn't matter whether the menu is created in code (using C#) or declaratively (XML).

  • Why is there a nesting limit? Is it documented somewhere?
  • Is there anything we can do to override this limit? The figure '5' in the message looks suspicious, like there is some magic int value to be set somewhere...
  • Are there any other controls that can be used to display a multi-level nested menu inside an Excel ribbon?

Thanks and best regards,
Thomas

tvoigt
  • 1

1 Answers1

0

I don't profess any great knowledge on this, just an interest.

I have tried nesting menu controls on the Visual Ribbon Designer in VS2013 also and indeed you can only go to 5 levels deep. When run with some items added an error message (on each of the added items) is generated, with the maximum 5 nesting levels appears. So it does look like this is an absolute limit! Also looks like this error message IS the documentation! The error message relates to the XML CustomUI code so it is unlikely to be worked-around.

However, at the fourth level it looks like you can add a SplitButton and add items to this which may give you the added options that you need. There may also be scope in adding a Gallery control at this level, if this fits your application. It is also interesting that the maximum number of SplitButtons you can nest in this way also appears to be 5.

May be time to consider a bit of UI re-design?

barryleajo
  • 1,956
  • 2
  • 12
  • 13