4

I'm trying to register a custom action on a site collection that adds a button to the SharePoint ribbon. I want to do this using the object model and not declaratively in XML. Does anyone know of this is even possible? I've been looking at SPRibbonButton but cannot figure a way to achieve this.

  • @orl78: Remember to mark questions as answered if you have an answer that works for you. This rewards those that help you out. Thanks! – Alex Angas Sep 1 '10 at 7:19
3

You can use the SPRibbon.RegisterDataExtension() to insert Ribbon stuff. You're inserting XML though through this method.

  • Thanks Wictor, yeah I had seen this method and thought it may be the solution. I was hoping though that there may be a way to set properties on an spribbonbutton object and then call .add() or similar. Thx again – Anonymous Aug 28 '10 at 19:50
1

The following links to an example using the RegisterDataExtension() method

Walkthrough: Creating a Custom Web Part with a Contextual Tab

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy