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.
Asked
Active
Viewed 1,131 times
4
-
@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 01 '10 at 07:19
2 Answers
3
You can use the SPRibbon.RegisterDataExtension() to insert Ribbon stuff. You're inserting XML though through this method.
Wictor Wilen MCA MCM MVP
- 18,207
- 40
- 64
-
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 – 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
Ronak Patel
- 3,261
- 3
- 23
- 45
Paul Lucas
- 4,246
- 1
- 17
- 18