I'm working on a comboBox XML Ribbon Control and I'm going crazy to obtain the index of the selected item.
This is the Ribbon XML code with the comboBox:
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="SearchCustomerTab" insertAfterMso="TabAddIns" label="Cliente" visible="true">
<group id="SearchCustomerGroup" label="Cliente" autoScale="true">
<comboBox id="CustomerComboBox" getItemCount="GetItemCountCallback" getItemLabel="GetItemLabelCallback" getItemID="GetItemIDCallback" onChange="OnChangeCallback" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
With getItemCount and getItemLabel callback I correctly fill che comboBox (oTabCustomersList is a List of a custom class):
Public Function GetItemCountCallback(ByVal control As Office.IRibbonControl) As Integer
Return oTabCustomersList.Count
End Function
Public Function GetItemLabelCallback(ByVal control As Office.IRibbonControl, index As Integer) As String
Return oTabCustomersList(index).NomeCompleto
End Function
With getItemId callback I set the index of every item in the ID:
Public Function GetItemIDCallback(ByVal control As Office.IRibbonControl, index As Integer) As String
Return index.ToString
End Function
but with onChange callback I can obtain the item label but not the ID or the selected index:
Public Sub OnChangeCallback(ByVal control As Office.IRibbonControl, text As String)
Debug.WriteLine("OnChangeCallback text: " & text) 'text = item label
End Sub
Is there a way to obtain the index of the selected item with the Ribbon comboBox control?
Thanks in advance,
Simone