Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to hide items from ribbon in sahrepoint 2010?

Posted on 2010-09-16
10
Medium Priority
?
1,812 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
LVL 2

Accepted Solution

by:
Serge_Uly earned 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

972 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