ADXRibbonDropDown

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

ADXRibbonDropDown
SelectedItemIndex 
Arie Bensimon




Posts: 20
Joined: 2007-06-05
Hey Sergey,
when I set the SelectedItemIndex of the ADXRibbonDropDown,
the SelectedItemIndex is updated ok, but the dropdown doesn't show the Item...It shows ""...
Posted 13 Jun, 2007 09:50:09 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Arie, when do you change the SelectedItemIndex property?



P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 13 Jun, 2007 10:14:52 Top
Arie Bensimon




Posts: 20
Joined: 2007-06-05
I've made a class that simulates the ADXRibbonDropDown DataBinding.
Among others, it's constructed with a CurrencyManager ref whose position is set according to the ADXRibbonDropDown SelectedItemIndex. But vice versa, I need the CurrencyManager position to be able to set the SelectedItemIndex.

cbo.SelectedItemIndex = cm.Position
In debug, i see that the value is indeed updated, but visually the dropdown shows a null String "" as soon as I change the SelectedItemIndex property.
The items' caption are set properly and are shown right when the dropdown is handled with the mouse.

It doesn't matter when or where.
the "cbo.SelectedItemIndex=i" updates the value but doesn't show the item Caption. So for instance at startup, the dropdown is populated and the SelectedItemIndex is set to 0 but the dropdown shows a blank string.
This is bad...
Posted 14 Jun, 2007 02:51:37 Top
Arie Bensimon




Posts: 20
Joined: 2007-06-05
Besides, Once it's populated ,
the ADXRibbonDropDown.Items.Clear()
as well as the ADXRibbonDropDown.Items.add(ADXRibbonItem) don't refresh the displayed Items!!!
Need an answer quick please...

Note:
My employer is starting to hick up on a 350$ component that doesn't implement basic .net functionality such as databiding or refreshing it's controls.(not to talk about the custom controls package that can't be implemented in the 2007 ribbons).

Posted 14 Jun, 2007 08:03:45 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Arie.

Please use the InvalidateControl method of the AddinExpress.MSO.IRibbonUI interface to refresh the collection of the drop down items. You can get an instance of the Ribbon UI in the OnRibbonLoaded event handler.
What Office application do you use? If it is Outlook, you can only update your controls when the Ribbon (Outlook inspector) is active.
Posted 14 Jun, 2007 10:18:44 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Arie, as to SelectedItemIndex issue, please set the property to 0 at the design time. It will force Ribbon to use the getSelectedItemIndex_Callback function to update the selection by index dynamically when the items collection is not empty.
Posted 14 Jun, 2007 11:49:08 Top
Arie Bensimon




Posts: 20
Joined: 2007-06-05
Ok Sergey, this does the trick.
If I had several ribbons, I would I identify the right instance?
Posted 17 Jun, 2007 08:00:33 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Arie.

In this case all ribbons with the same Id will be refreshed at one time. However, in Outlook you will have to activate an appropriate Ribbon to see the changes.
Posted 18 Jun, 2007 16:28:30 Top
Arie Bensimon




Posts: 20
Joined: 2007-06-05
Look, first I get an instance of the ribbon:
Dim DistRibbon As AddinExpress.MSO.IRibbonUI
Private Sub AddinModule_OnRibbonLoaded(ByVal sender As Object, ByVal ribbon As AddinExpress.MSO.IRibbonUI) Handles MyBase.OnRibbonLoaded
DistRibbon = ribbon
End Sub

Now every time the DropDown collection changes I have to invoke:
DistRibbon.InvalidateControl("adxRibbonDropDown_e07582a71a454c438fc514d071a4b7ce")

please correct me:
What you say is that DistRibbon.InvalidateControl("adxRibbonDropDown_e07582a71a454c438fc514d071a4b7ce")
will refresh the dropdown no matter what instance of the ribbon i store in DistRibbon?

PS: Can we expect an update where the addInModule takes care of this...?
Posted 19 Jun, 2007 04:01:19 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Arie.

An instance of the Ribbon UI stored in the DistRibbon field will always be the same regardless of types of opened Outlook inspectors. I have already tested this situation.
Posted 19 Jun, 2007 09:24:36 Top