Solved

How to hide items from ribbon in sahrepoint 2010?

Posted on 2010-09-16
10
1,712 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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

16 Experts available now in Live!

Get 1:1 Help Now