Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've tried to create drop down custom action for some time without any success and Google also can't help me. Anybody could to share example how to use DropDown Element as custom action?

Thx for help.

UPD 1:

Here is a code of my custom action, Button in this custom action works fine, but when I change it to DropDown I got error:

<CustomAction
   Id="Ribbon.Library.Actions.PrintTaskCard"
   Location="CommandUI.Ribbon.DisplayForm"
   RegistrationId="7006"
   RegistrationType="List"
   Title="Print">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition
      Location="Ribbon.ListForm.Display.Manage.Controls._children">
      <!--<Button
        Id="PrintTaskCard"
        Command="PrintTaskCard"
        Description="Print"
        LabelText="Print"
        Sequence="1020"
        Image32by32="/_layouts/images/print.png"
        TemplateAlias="o1"/>-->

      <DropDown
        Id="PrintTaskCard"
        Width="100">
        <Menu>
          <MenuSection>
            <Controls>
              <Button Id="PrintTaskCardB"
                      Command="PrintTaskCard"
                      Description="Print"
                      LabelText="Print"
                      Sequence="1020"
                      Image32by32="/_layouts/images/print.png"/>
            </Controls>
          </MenuSection>
        </Menu>
      </DropDown>
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler
      Command="PrintTaskCard"
      CommandAction="javascript: printTaskCardClicked('{SiteUrl}','{ListId}','{ItemId}');"
      EnabledScript="javascript: printTaskCardEnable('{ItemId}');"/>
  </CommandUIHandlers>
</CommandUIExtension>

UPD 2: I need to create DropDown menu like in image below in Ribbon Toolbar:

Sorry, I haven't need reputation to add images in posts, so here is a link to image, that illustrates what I need to implement

share|improve this question
    
could you share your code? –  Salvatore Di Fazio May 7 '13 at 14:58
    
@SalvatoreDiFazio I've updated description of problem –  coirius May 7 '13 at 16:11
    
I think you need to use a SplitButton if you want to match the image in your link. MSDN SplitButton Element –  Aquila Sands Jun 18 at 15:39

1 Answer 1

I have done this in the Edit Control Block; If you are trying to create a drop down in the Ribbon, I cannot help you, but Chris O'Brien has a fantastic walk-through that you might find helpful.

Adding an entry to the Edit Control Block

code:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="ApproveContractECB"
                Location="EditControlBlock"
                Title="Approve Contract Request"
                RegistrationType="List"
                RegistrationId="100"
               ImageUrl="/_layouts/ContractApproval/img/approve_comment.png">
    <UrlAction Url="javascript:OpenPopUpPageWithTitle('{SiteUrl}/Lists/Contract%20Approval%20State/NewForm.aspx?ContractTitle={ItemId}', RefreshOnDialogClose, 800, 600,'Approve or Reject Contract Request')"/>
  </CustomAction>
</Elements>
share|improve this answer
    
Thank you for advice, but it's not exactly what I need to implement. I've added image that illustrates what I need to implement. –  coirius May 7 '13 at 19:20
    
The link that I posted is part of a series, his second article in the series describes how to add new options to existing groups. sharepointnutsandbolts.com/2010/01/… –  James Grizzle May 8 '13 at 14:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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