When I select one of the values in my DropDown (or ComboBox, tried both), the event gets triggered correctly, but the selected item is not shown when the DropDown is closed (the box stays empty). I thought it was a default behaviour to be filled in (like e.g. Language dropdown). I have the problem with both static and dynamically loaded controls.

    <Menu Id="MyNS.SharePoint.Ribbon.MyGroup.Dropdown.Menu">
       <MenuSection Id="MyNS.SharePoint.Ribbon.MyGroup.Dropdown.MenuSection">
          <Controls Id="MyNS.SharePoint.Ribbon.MyGroup.Dropdown.MenuSection.Controls">
             <Button Command="SomeCommand" Id="MyNS.SharePoint.Ribbon.MyGroup.Dropdown.Button1" LabelText="Sometext" />
             <Button Command="SomeCommand" Id="MyNS.SharePoint.Ribbon.MyGroup.Dropdown.Button2" LabelText="SomeText" />

2 Answers 2


Unfortunately, all this has to be done manually.

First of all, you will need to provide QueryCommand attribute of DropDown element, and return the correct current value manually to the properties["Value"] variable from the handler script (properties is the second parameter passed to handleCommand function of your ribbon page component).

So you will need some global js variable for storing the current value of the dropdown.

When Button1 or Button2 is pressed, you should update the global variable with the corresponding value. Then, you will have to execute "application state changed" command, to force execution of all the query commands on the page.

"Application state changed" command can be executed with the following code:


I've just tested this solution and it works.

P.S. Probably you might be interested to try my opensource project SharePoint 2010 Fluent Ribbon API, which aims to simplify dealing with ribbon and provides MUCH easier interface for this kind of tasks. It supports DropDowns starting from the 1.4 release. I have an example of using DropDown, fetching value from it, etc., in FluentRibbon.Elementary sample project (in RibbonWebPart.cs), which can be found under the [Source Code] tab on CodePlex.

  • Should have known nothing is for free in SharePoint :) I'll keep your API in mind for the next project in which I'll have to change the ribbon, thanks !
    – Bart
    Commented Jan 6, 2012 at 7:57
  • "..and return the correct current value manually to the properties["Value"].." can u please explain what "the correct value" means?
    – user8095
    Commented Apr 28, 2012 at 11:47
  • @Dmitry, I mean you should leverage QueryCommand attribute and place some javascript code there, which must assign some value to properties["Value"]. This value is supposed to be equal to caption of the last clicked item of the Dropdown, i.e. it's current selected item. Commented Apr 30, 2012 at 11:12
  • thank u a lot. But in QueryCommand i have no selected items(even no items in dropdown). In QueryCommand i just try to set the default value and load some data. I tried to assign different values to properties["Value"], but no luck with default value. what kind of value i should set to properties["Value"] during initialization?
    – user8095
    Commented Apr 30, 2012 at 14:26

You don't need to do anything manually. You probably have the wrong SelectedItemDisplayMode in your xml. Try setting it to "Menu". The default does not display the item. It will only display something if you set properties.value to something.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.