0

I am currently using the DynamicItemStart feature to create a list of menu items dynamically and it works fine for normal button items. Is there a way to also dynamically create a list of sub-menus that will then contain the actual command buttons? I want to achieve a structure like this:

File
  My Root Item 
    Group 1 (dynamic)
      Item 1.1 (dynamic)
      Item 1.2 (dynamic)
      Item 1.3 (dynamic)
    Group 2 (dynamic)
      Item 2.1 (dynamic)
    Group 3 (dynamic)
      Item 3.1 (dynamic)
      Item 3.2 (dynamic)

Is this even possible?

Danielku15
  • 1,490
  • 1
  • 13
  • 29

1 Answers1

0

You can declare maximum number of groups (say 10) in your .vsct file - 10 Groups and 10 corresponding Menus, with TextChanges, DynamicVisibility and DefaultInvisible CommandFlags for Menus.

When you need to show a group, you add a corresponding OleMenuCommand and in the BeforeQueryStatus handler set menu command Text and Visible status.

For items you continue to use DynamicItemStart.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66