Create SharePoint 2010 ribbon button programmatically w/o feature XML -


I have to create a SharePoint 2010 ribbon element (tabs, buttons, groups, etc.). Is there a way to create such elements through the SharePoint API without using custom actions?

EDIT: I just got the ability to add elements like this:

  SPRibbon r = SPRibbon.GetCurrent (page); R.RegisterDataExtension (/ * Ribbon element code with * XmlNode *); Another solution would be to add custom web controls and add dynamic controls to this "placeholder".  

Is there a way to create elements without using xml nodes?

For layout pages and webpages, you can create ribbons without any XML.

For example, for the layout page, you get the Ribbon Youthil. Ribbon must be inherited from the layout page and must provide its own definition of the ribbon.

Code for the simplest page with custom ribbon tab & amp; A button will look like this:

  Public Partial Category MyRibbonPage: Ribbon LayoutPage {Public Override Tab Definition GetTabDefinition () {New Tab Return to Reflection} {ID = "Test Ribbon", Title = "Test" , Group = new group definition [] {new group definition () {id = "test group", title = "test group", template = groupTemplate library. Simple Template, Control = New Control Definition [] {New Button Definition} {ID = "TestBooten" Title = "Test Button", Command Java Script = "Alert ('Test!');", Image32Url = "/ _layouts / Images / lg_ICHLP.gif ",}}}}}; }}  

You will find more examples and very good documents on ProjectPage on CodePlex.

AFAIK, the simplest and quickest way to create a ribbon now is Programming for the Program page & amp; WebPers.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -