?
Solved

How to hide items from ribbon in sahrepoint 2010?

Posted on 2010-09-16
10
Medium Priority
?
1,798 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

719 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