Hide the SharePoint Page Ribbon – Programatically


Hide the SharePoint Page Ribbon – Programatically

  SPRibbon oribbon = SPRibbon.GetCurrent(this.Page);
   if (oribbon != null)
   {
  //hide the ribbon buttons on the wiki page
  oribbon.TrimById(“Ribbon.WikiPageTab.Manage”);
  oribbon.TrimById(“Ribbon.WikiPageTab.Share”);
  oribbon.TrimById(“Ribbon.WikiPageTab.PubPageActions”);
oribbon.TrimById(“Ribbon.WikiPageTab.LibrarySettings”);
//hide the ribbon menus on the webpart page
     oribbon.TrimById(“Ribbon.WebPartPage.Manage”);
    oribbon.TrimById(“Ribbon.WebPartPage.Share”);
 oribbon.TrimById(“Ribbon.WebPartPage.Approval”);
 oribbon.TrimById(“Ribbon.WebPartPage.Workflow”);
oribbon.TrimById(“Ribbon.WebPartPage.Actions”);
 }
Reference : Microsoft.Web.CommandUI DLL

Default Server Ribbon Customization Locations:

SharePoint 2010: How to remove preview button from Ribbon of Wiki Page

Advertisements

About sharepointsriram

9+ Yrs of IT experience
This entry was posted in Sharepoint 2010 Ribbon. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s