Solved

How to hide items from ribbon in sahrepoint 2010?

Posted on 2010-09-16
10
1,775 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Windows app updating JSON file error. 9 50
sharepoint 2013 foundation 2 46
Regarding Disk IO 3 88
WPF and Powershell button hover change text 5 63
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…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

759 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