Programatically selecting an item in a dynamically populated ADXRibbonDropDown

Add-in Express™ Support Service
That's what is more important than anything else

Programatically selecting an item in a dynamically populated ADXRibbonDropDown
 
David Jones


Guest


Hi there

I have two dynamically-populated ADXRibbonDropDowns in my Excel ribbon. Once the dropdowns have been populated I want to programatically select an item in each of them. I have seen a couple of threads on this forum that discuss this but neither seems to provide a full solution - can you describe the exact process I have to follow to do this, please?

Thanks very much

David
Posted 03 Jun, 2013 11:47:51 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello David,

I suppose that you modify the Sel ectedItemIndex (or SelectedItemId) property at run time and it doesn't work. Is this correct?

You need to choose if you work with indeces or with ids. Then you need to explicitly specify the SelectedItemIndex (or SelectedItemId) property at design time; leaving the default value causes the issue you are having. Then you need to modify the SelectedItemIndex (or SelectedItemId) property at run time.

Regards fr om Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 04 Jun, 2013 11:29:28 Top
David Jones


Guest


That's fixed it.

So now I add a dummy entry to the ADXRibbonDropDown at design time ('No data') and specify that to be the selected item. Then, when the range gets populated at run time I am now able to specify any of the new entries to be the selected one.

Thanks very much!

David
Posted 07 Jun, 2013 06:09:50 Top