Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Hello i'm developing a sharepoint project and central admin pages (located in _layouts), and i want to use Ribbon bar. i have found this sample but i hope so, it is wrong..

http://sharepointsolutions.com/sharepoint-help/blog/index.php/2009/10/creating-a-custom-ribbon-tab-in-sharepoint-2010/

page throw this error: Ribbon node must have a subnode.

Element.xml have a and subnode, i don't found any error this file..

How can i add Ribbon to the custom page? Do you have a suggestion?

Thanks,

share|improve this question
Can you post the part of your elements.xml file that has the ribbon in it? – Greg Hurlman Jan 7 '10 at 16:23

2 Answers

=( this way not working..

Exception: System.ArgumentException: Ribbon Tab node must have a Scaling subnode. at Microsoft.Web.CommandUI.Ribbon.CreateRenderContext(CUIDataSource uiproc) at Microsoft.Web.CommandUI.Ribbon.Render(HtmlTextWriter writer)...

My Element XML

    <CommandUIDefinition Location="Ribbon.Tabs._children">
      <Tab
        Description="Custom Tab"
        Id="ParameterManagerRibbon.CustomTab"
        Sequence="1"
        Title="Custom Tab">
        <Scaling Id="ParameterManagerRibbon.CustomTab.Scaling">
            <MaxSize
            Id="ParameterManagerRibbon.CustomTab.CustomGroup.MaxSize"
            GroupId="ParameterManagerRibbon.CustomTab.CustomGroup"
            Size="LargeLarge"
            Sequence="10" />
          <Scale GroupId="ParameterManagerRibbon.CustomTab.CustomGroup" Size="Large" Id="ParameterManagerRibbon.CustomTab.CustomGroup.Scale"/>
        </Scaling>
        <Groups Id="ParameterManagerRibbon.CustomTab.Groups">



          <Group
            Id="ParameterManagerRibbon.CustomTab.CustomGroup"
            Sequence="1"
            Title="Custom Group"
            Template="Ribbon.Templates.Flexible2"
            Image32by32Popup="/_layouts/images/RibbonCustomization/images32x32.png"
            Image32by32PopupTop="-128"
            Image32by32PopupLeft="-192">
            <Controls Id="ParameterManagerRibbon.CustomTab.CustomGroup.Controls">


              <Button
                Id="ParameterManagerRibbon.CustomButton"
                Sequence="20"
                Command="ParameterManagerRibbon_CustomButton"
                LabelText="Custom Button Label"
                Alt="Custom Button alt text"
                Image16by16="/_layouts/images/RibbonCustomization/images16x16.png"
                Image16by16Top="-16"
                Image16by16Left="-32"
                Image32by32="/_layouts/images/RibbonCustomization/images32x32.png"
                Image32by32Top="0"
                Image32by32Left="-64"
                TemplateAlias="o1"
                ToolTipTitle="Custom Button"
                ToolTipDescription="Executes custom action" />

            </Controls>
          </Group>




        </Groups>
      </Tab>
    </CommandUIDefinition>



  </CommandUIDefinitions>
  <CommandUIHandlers>
      <CommandUIHandler
        Command="ParameterManagerRibbon_CustomButton"
        CommandAction="javascript:alert('Button clicked.');"
        EnabledScript="true" />
  </CommandUIHandlers>
</CommandUIExtension>

share|improve this answer
i use this cs code in page load var ribbon = SPRibbon.GetCurrent(Page); if (ribbon != null) { ribbon.Minimized = false; ribbon.CommandUIVisible = true; const string initialTabId = "Ribbon.ParameterManagerRibbon"; if (!ribbon.IsTabAvailable(initialTabId)) ribbon.MakeTabAvailable(initialTabId); ribbon.InitialTabId = initialTabId; } – Mehmet Yazıcı Jan 12 '10 at 12:07

please check out the

http://www.projectserver2010blog.com/2010/01/sharepoint-2010-ribbon-customization.html and relative blog posts. There is a solution you are looking for.

share|improve this answer

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.