Solved

How to hide items from ribbon in sahrepoint 2010?

Posted on 2010-09-16
10
1,729 Views
Last Modified: 2012-05-10
Hii All,
 I have sharepoint 2010 and sharepoint 2010 has good feature of ribbon. Ribbon has so may items. But user wants some particular items so they want me to delete or hide those unnecessary items.

So please if you got this kind of situation then let me know..

Thank you in advance..
0
Comment
Question by:guessdip
  • 5
  • 3
  • 2
10 Comments
 
LVL 9

Expert Comment

by:SharePointGirl
ID: 33694929
You can use code like

 public void HideRibbonItem()
 {
      //if this is a System.Web.UI.Page
      SPRibbon ribbon = SPRibbon.GetCurrent(this);
      ribbon.TrimById("Ribbon.ListItem.New.NewFolder");
     
}
0
 

Author Comment

by:guessdip
ID: 33696751
Hii,
 Where can i use this code? is it possible to use any content editor web part? Exactly i need to remove some icons from ribbon in documnet library page. So how do i use this code? can you explain me in detail?
0
 
LVL 9

Expert Comment

by:SharePointGirl
ID: 33698798
You can create your own web part to do this. Alternatively you can use CSS to hide items in the ribbon

http://andreasglaser.net/post/2010/02/21/SharePoint-2010-Ribbon-e280a6-becoming-a-SP2010-developer-Part-3.aspx
0
 
LVL 2

Expert Comment

by:Serge_Uly
ID: 33702421
Read this article: http://msdn.microsoft.com/en-us/library/ff630938.aspx.
To hide button use HideCustomAction element.
0
 

Author Comment

by:guessdip
ID: 33704366
Hii,
 I am able to add custom item in ribbon but i am not able to hide any item. i did follow all step. i wrote code

<HideCustomAction Id="Ribbon.ListItem.New.NewFolder" Location="Ribbon.ListItem.New.NewFolder">
  </HideCustomAction>
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 2

Accepted Solution

by:
Serge_Uly earned 500 total points
ID: 33712488
Hi,
Not have idea why it's not working with ListItem.New.NewFolder.
But you can redefine NewFolder button, just use this CustomAction:
  <CustomAction Id="RemoveNewFolder" RegistrationId="100" Location="CommandUI.Ribbon"
                   RegistrationType="List">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListItem.New.NewFolder" />
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
0
 

Author Comment

by:guessdip
ID: 33718094
Hii Sir,
 I tried this code too. i am sending you ribbon pic of sharepoint 2010. i want to remove New Folder option from Documnet library ribbon. I dont want to create any custom item in ribbon . i want to remove existing item from ribbon.

I am not sure what mistake i am making. i guess you couls right but i tried this code and deploy. Can you explain me in detail ??
RibbonPic.JPG
0
 
LVL 2

Expert Comment

by:Serge_Uly
ID: 33724055
Hi,
You wrote "Ribbon.ListItem.New.NewFolder" and I thought - you want disable button for listItem.

In this code you dont create button, just redefine NewFolder button for Document library by empty code:
 
  <CustomAction Id="RemoveNewFolder" RegistrationId="0x01" Location="CommandUI.Ribbon"
                   RegistrationType="ContentType">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Documents.New.NewFolder" />
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
0
 

Author Comment

by:guessdip
ID: 33728285
Hi,
 Thank you so much. I got it. Keep in touch. I already asked another question if you could help me.. Anyway i did learn from you.
0
 

Author Closing Comment

by:guessdip
ID: 33728295
Thanks Dude..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now