SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add a custom button to a SP2010 ribbon in the DisplayFormToolbar for a list item. The list is external, although I don't think that matters but still...

This is my custom action definition:

  <CustomAction Id="{0116B081-B13E-4A4B-8F8D-EF7AC1E43BFD}"
                ControlAssembly="myAssembly, Version=, Culture=neutral, PublicKeyToken=...."
                ControlClass="myNamespace.MyRibbonButton" />

myNamespace.MyRibbonButton class extends System.Web.UI.WebControls.Button and has some basic code inside OnInit.

When I access the display form of an item in the external list, in debug I can see that OnInit is executed, there is no exception in the logs... but the button does not show in the form!

I have specified my assembly with SafeControl so that's not the cause.

Even if I add this to my custom action is still does not display:

        <CommandUIDefinition Location="Ribbon.ListForm.Display.Manage.Controls._children" />

What could I be missing?

share|improve this question
up vote 3 down vote accepted

SharePoint 2010 ribbon doesn't have anything in common with 2007's DisplayFormToolBar.

The custom action Location attribute should be set to "CommandUI.Ribbon" for adding something to ribbon.

Then, you should provide special XML for button. Since SP2010 ribbon is a client-side thing, no C# code is involved here.

You can find a simple example of adding a button to ribbon here:

P.S. Also, you can consider using SharePoint 2010 Fluent Ribbon API opensource project to work with ribbon in a simplified way. A quick how-to start can be found at project's documentation site. It is my project actually, and I cannot resist mentioning that it is a rather popular project and we use it in real-world projects at work intensively.

share|improve this answer
Are you saying that I can't use the ControlAssembly/ControlClass attributes to define my own control to show in the ribbon? Also, I've set the location to "CommandUI.Ribbon" and the button is still not displayed and now my code isn't executed anymore! – JohnDoDo Feb 6 '12 at 10:21
That's right, ribbon controls could be defined using XML only, and actions for them are specified as JavaScript code. – Andrey Markeev Feb 6 '12 at 10:24
So what are the ControlAssembly and ControlClass attributes used for then? – JohnDoDo Feb 6 '12 at 10:38
They may be used for some other customizations, which are performed through CustomActions. But not for ribbon customizations. – Andrey Markeev Feb 6 '12 at 10:49
Please consider the following MSDN article, which describes possibilities of Ribbon customizations: – Andrey Markeev Feb 6 '12 at 10:50

Your Answer


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.