Home » Sharepoint 2010

show/hide ribbon button


I hope I am posting this in the correct area. :-)

I am designing and customizing the moss 2010 for internet. I would like to make the ribbon bar on top invisible for all users. I know about the "HIDE RIBBON" under the "SITE ACTIONS", but the thing is, this button is not there?!

do I have to activate something special, so that I can see this option? any special site collection feature?

and the other question is, when I use this "HIDE RIBBON", is it stll visible for administrators and contributors?


thank you




8 Answers Found


Answer 1

You need to post sharepoint 2010 questions here http://social.technet.microsoft.com/Forums/en-US/category/sharepoint2010

They will not get answered in this forum


Answer 2

thank you for moving the question to the right area!

I really hope someone can help me with that...



Answer 4

hi KSDN,

thank you for your answer. I already saw this one, but I honestly don't know where to put this code?

do you know where I have to add it?


Answer 5

Hi miimoss,

They are suggesting to make changes to:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\v4.master

Important: Please ensure to backup the original file(s), before making any changes.


Answer 6

hi KSDN,

thank you again, but I am not using the v4.master on my portal, I have a customized masterpage.

and I am not that big codingtype :-), more the designertype, wher in my masterpage do I put this code, in the HEAD? or elswhere?

Or before the ribboncode?

thank you


Answer 7



Use below code in your master page any where in footer, I think it will help you.

<asp:LoginView id="LoginView" runat="server">
     <style type="text/css">
       body #s4-ribbonrow {
        display: none;
       <style type="text/css">
       body #s4-ribbonrow {




I hope I am posting this in the correct area. :-)

I am designing and customizing the moss 2010 for internet. I would like to make the ribbon bar on top invisible for all users. I know about the "HIDE RIBBON" under the "SITE ACTIONS", but the thing is, this button is not there?!

do I have to activate something special, so that I can see this option? any special site collection feature?

and the other question is, when I use this "HIDE RIBBON", is it stll visible for administrators and contributors?


thank you





How to hide/Disable Restore down button in word 2010 ribbon bar in C# and WIN32 APIs?

I got to know that Ribbon Accessible API can be used for this purpose. But could not find any sample in the google. I would appreciate if u suggest a solution using c# and WIn 32 APIs like SetWindowLong API etc.






MS officially released MS Ribbon for WPF. This release doesn't support theming, it comes with a default blue theme, Office 2010 look&feel. Office 2010 has a button that allows users to hide/unhide the ribbon, but the released version of ribbon doesn't has one. Is it implemented ? How can I add one? 




Is it possible to disable a button on the ribbon interface using code, for example if I have a list where I would like to disable the delete button..




If I create a new sharepoint project with a ribbon extension element and deploy it (with visual studio) then all appears well and the button appears on the ribbon. If I then use retract  it also appears to work and the button disappears. However, any subsequent changes (e.g. to the title text or the command handler) do not appear to deploy and only the original button gets displayed. No matter what I try I can’t seem to get the button to deploy after the first attempt.

Patrick Malatack kindly solved this problem for me:

"the problem is your browser cache… clear your browser cache.  The browser downloads ribbon xml on load and this xml stays around.  I actually added a post build process in VS to address this."

Further investigation revealed that there are two files that get downloaded to your browser cache that affect this

commandui.ashx?....    ....&qt=ribbonvisibletabdeep
commandui.ashx?...    ....&qt=commandhandlers

Deleting both of these files after redeploying the custom ribbon items but before going back into PS ensures that the changes are visible/functional.


I used SP2010 Beta for 7 months and the Customize Form button was available on the ribbon for lists. Now, I am on the RTM, and cannot figure out how to show this button. Is it a feature? Do you have to have InfoPath 2010 installed locally? (I do have this, but just wondering).

Thanks in advance.


Hello all,

As a bit of background: I'm currently busy developing a content type with some kind of status (waiting / in progress / done). I want to make the users life a bit easier to complete an item so I want to add a button to the ribbon that sets the selected items status to "Done".
This works when I go to the list and click on the item (I see my button and it works perfectly). The problem is that this button is not visible when I add a view of this list on the homepage, then suddenly my button does not show.

Does anybody know what can be done to also show the button inside the ribbon of the XsltListViewWebpart? Below is my elements.xml that I use.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  Title="Add a Ribbon Button">
     <Button Id="Ribbon.ListItem.Actions.NewRibbonButton"
      Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="-0"
      Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-128" Image32by32Left="-256"
      TemplateAlias="o2" />
      function enableDisableButton()
       var items = SP.ListOperation.Selection.getSelectedItems();
       return (items.length > 0);
      enableDisableButton();" />
 <CustomAction Id="InstallationFlow.Script"
        ScriptSrc="/_layouts/ACV.SharePoint.Flow/InstallationFlow.js" />

My blog on WSS / MOSS development is found at http://jebass.blogspot.com


Wondering if any one else seen this, I noticed custom ribbon buttons don't show up when I select item in document library in webpart view. Site is created using team site template and the webpart that shows contents of a document library is inside of a wiki editing control in team site home page

Button shows up correctly when I select the item once in document library view

I want to limit the number of buttons in the group of a ribbon in Word 2007 as the buttons are getting generated on the basis of data in the database. See the pic below ,. I wanted to have limited number, say 6 or so in the ribbon with a dialogboxlauncher which when clicked will open a pane showing all the buttons. Is there any way of doing the same. Can somebody also tell me how to create that pane when somebody clicks on the dialogbox launcher?

Hey everyone,


Was wondering, how do you hide the close button of a modal dialog, when it's already shown, i.e. the page that's being loaded into the dialog, in there is a web part, and i want to trigger a script call to hide the close button of the current modal container.

I know you could give options to the modal dialog when you shot it to hide the close button, but not sure if you can do it after it has shown. I have no control of adding the option when it's showing the dialog, as this is done by the Add new item link in a list.




I have an app that I've converted from Access 2003 mdb to Access 2010 hybrid (local accdb and sharepoint) which does not respond to DoCmd.ShowToolbar "Ribbon", acToolbarNo as it should. There is no autoexec macro at this point, so I can test.

I created a completely new form with DoCmd.ShowToolbar "Ribbon", acToolbarNo in every On Open On Load etc type event, set it as the startup form, and the app still shows the ribbon. I put a button on the new form (which has nothing else) that runs DoCmd.ShowToolbar "Ribbon", acToolbarNo and it does not hide the ribbon.

Yet if I hold down the shift key when starting the app, and then load that test page, the ribbon is hidden.

Since there is no autoexec, what could be making the difference? I've adjusted nearly every setting in File Options and none have an impact. Coming at it from the other side, I created a new accdb and have tried to create the problem by adjusting everything in File Options. But nothing I do in the test db will repro the issue.

I found one posting about an issue like this


The fix he came up with was to recreate the db from scratch. I can't do that.

It's almost as if there is some startup property that was set in Access 2003 before conversion and which no longer has a control point in Access 2010.


I have a aspx page with two buttons and a 2 div below

When click on button1 both div should be visible, on button2 click only 1 div should be visible

and on page load none should be visible How to dod this?

Also, I do not want the page to refresh.

I am sorry I am new to asp.net and I have not done this before, so if i am in the wrong forum, my apologies.


I have the following line on my aspx page..

<div id="btnAddVidCart" runat="server" style="text-align:right; padding-right:75px;" visible="false" ><div class="buttonright" style="float:right;"></div><asp:Button ID="btnAddVideo" runat="server" style="width:200px;float:right;" OnClick="btnAddVideo_Click" Text="Add Selected Items to Cart" CssClass="searchbutton" Visible="false" /><div class="buttonleft" style="float:right;"></div></div>

My issue is, that i only need this to display when my datalist is displayed and has records.. every time else, it needs to be hidden ( Visible = false )

on page_load i have it set to 

btnAddVideo.Visible = false;

btnAddVidCart.Visible = false;


Should i only be check then within my dropdown event? By default the page is displaying my datalist, so it should be hidden.. then you have a dropdown to make a selection, if you change it, then it should show ONLY if there are records to be displayed.



hi friends,

How to show/hide gif image when button click in asp.net


i have a web form using a simple workflow.

the workflow consists of single line to start approval process with a single approver

in the form i have a "submit" button which i hide after it has been submitted.

how do i display it again after it has been "returned for correction" ?




This is shared addin for excel 2007 using ribbonX, VS 2008

When selection in excel changes, some ribbon should be grayed out

I did this way,

onload of ribbon, I save a reference of IRibbonUI to _ribbonUI

then in ApplicationSheetSelectionChange event handler,



set RibbonButton1.getEnabled to a callback where I decide the button should be enabled or disabled


publicbool IsEnabledCallBack(IRibbonControl control)

This works fine b/c in the callback, based on control.Id I can know which ribbon button

However, I want to know if there is way that I can directly get hold of RibbonButton1 from _ribbonUI (not callback of ribbon button),  e.g: in ApplicationSelectionChange handler, can I disable a ribbon button directly?



Hi all!

I'm trying to replace the "Delete page" button from the ribbon and replace it with my own delete button with custom code. I was able to remove the "Delete page" button from the ribbon with following code:

SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
if (ribbon != null)

But I become crazy adding my own button in place of the old one. I try several things, but nothing works!!!

I add a module (attached to a feature) within my SharePoint Project and add following xml code in this module:

 <CustomAction Id="Ribbon.WikiPageTab.Manage.DeletePage1Action"
    <CommandUIDefinition Location="Ribbon.WikiPageTab.Manage.Controls._children">
     <Button Id="Ribbon.WikiPageTab.Manage.DeletePage1"
         LabelText="Delete page"
         ToolTipTitle="Delete the current page"
         ToolTipDescription="This will delete the current page" />

But nothing is displaying.... :-(. WTF??? Just before this "CustomAction", I have another "CustomAction" (that is adding an ItemMenu in the SiteActions menu) that works perfectly.

I think I have some false reference on an ID or LOCATION.... but I can't find out what!!!

Thanks in advance for you help!








I'm trying to get a custom ribbon button on the Wiki's ribbon, ideally the Editing Tools > Format Text > Markup group.  I've deployed the solution but nothing appears to be showing up in the ribbon.  Any thoughts on where I've gone wrong?

<?xmlversion="1.0"encoding="utf-8"?><Elementsxmlns="http://schemas.microsoft.com/sharepoint/"><CustomActionId="WikiExtensions.Ribbon.EditingTools"Location="CommandUI.Ribbon"RegistrationId="119"RegistrationType="List"Sequence="20"><CommandUIExtension><CommandUIDefinitions><CommandUIDefinitionLocation="Ribbon.EditingTools.CPEditTab.Markup.Controls._children"><ButtonId="WikiExtensions.Ribbon.InsertCodeBlock"Alt="Notify hello"Sequence="5"Command="WikiExtensions.Command.InsertCodeBlock"Image16by16="/_layouts/images/NoteBoard_16x16.png"Image32by32="/_layouts/images/NoteBoard_32x32.png"Description="Uses the notification area to display a message."LabelText="Notify hello"TemplateAlias="o1"/></CommandUIDefinition></CommandUIDefinitions><CommandUIHandlers>
     SP.UI.Notify.addNotification('Hello from the notification area'); 
     " />


I am trying to form ribbon XML with the data from the database and following is what I wrote:-

      XNamespace xNameSpace = "http://schemas.microsoft.com/office/2006/01/customui";
      XDocument document = new XDocument();
      document.Add( new XElement (xNameSpace+"customUI"
                    , new XElement("ribbon"
                    , new XElement("tabs"))));
      // more code to add the groups and the controls with-in the groups
      // code below to add ribbon XML to the document and to add the relationship
       RibbonExtensibilityPart ribbonExtensibilityPart = myDoc.AddNewPart<RibbonExtensibilityPart>();
       ribbonExtensibilityPart.CustomUI = new DocumentFormat.OpenXml.Office.CustomUI.CustomUI(ribbonXml.ToString());

I don't see any error executing the above. However, when I open the changed document, I dont see my ribbon added. I see following in the CustomUI/CustomUI.xml inside the word:-

    <?xml version="1.0" encoding="utf-8"?><customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
      <ribbon xmlns="">

I am not sure how the "xmlns" attribute is getting added to the ribbon element. When I remove that attribute, the ribbon gets showed. 

Could anybody throw any idea on where am I going wrong?


What's needed to display the buttons of a Ribbon's DropDown button in small size? (with the 16x16 size instead of 32x32 size)


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure