none
Get Label from a selected item from a dropdown in a ribbon in access RRS feed

  • Question

  • I have a dropdown in a ribbon with the following drop downs.  I can get the item id but how do you retrieve the label?

    <group id="grpFiltersStRE" label="Filters">
              <box id="box1" boxStyle="horizontal">
               <dropDown id="ddState" label="   State " getItemLabel="ItemLabSel" onAction="GetSelectedItem">
                 <item id="st1" label="ALL" />
                 <item id="st2" label="IL" />
                 <item id="st3" label="MT" />
                 <item id="st4" label="NM" />
                 <item id="st5" label="OK" />
                 <item id="st6" label="TX" />
              </dropDown>
               <dropDown id="ddProtect" label="   Protect " getItemLabel="ItemLabSel" onAction="GetSelectedItem">
                 <item id="pr1" label="ALL" />
                 <item id="pr2" label="Y" />
                 <item id="pr3" label="N" />
                 <item id="pr4" label="A" />
                 <item id="pr5" label="M" />
              </dropDown>
               <dropDown id="ddDate" label="   Date " getItemLabel="ItemLabSel" onAction="GetSelectedItem">
                 <item id="dt1" label="ALL" />
                 <item id="dt2" label="ACTIVE" />
              </dropDown>
              </box>
             </group>

    Friday, December 28, 2018 5:24 PM

All replies

  • Hi Terry,

    You could use the following code to get the label: 

    public string getLabelWeek(Office.IRibbonControl control, int index)
            {             
                string str = xlWeekList[index];
                return str;
            }

    For more information, please refer to the following link:

    In a custon ribbon tab: How do I get the selected value of the dropDown list in the onAction method of a button?

    Best Regards,

    Bruce


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.


    Saturday, December 29, 2018 3:09 AM
    Moderator
  • Hi Terry,

    Have you solved your problem yet? if your issue is still exist then let us know about that, we will try to

    suggest you further to solve the issue.

    Best Regards,

    Bruce


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Wednesday, January 2, 2019 8:05 AM
    Moderator