miércoles, 24 de julio de 2013

Hide a Ribbon Button, using a Visual Web Part Sharepoint 2010



1.In a Visual Studio solution create new Visual Web Part.


2. Add the next Reference.


3. Add the next code.



4. Run, and add the Visual Web Part into the list page



Now, you will notice that the New Folder button does not appear




Here Default Server Ribbon Customization Locations you find the list of all Button in the Ribbon

Code

 using System;  
 using System.Web.UI;  
 using System.Web.UI.WebControls;  
 using System.Web.UI.WebControls.WebParts;  
 using Microsoft.SharePoint;  
 using Microsoft.SharePoint.WebControls;  
 using Microsoft.Web.CommandUI;  
 namespace ProyectosSharePoint.HideRibbonButton  
 {  
   public partial class HideRibbonButtonUserControl : UserControl  
   {  
     protected void Page_Load(object sender, EventArgs e)  
     {  
       SPRibbon oRibbon = SPRibbon.GetCurrent(this.Page);  
       oRibbon.TrimById("Ribbon.ListItem.New.NewFolder");  
     }  
   }  
 }  


easily =)

Regards.
Oscar Miguel Dominguez Acevedo.

No hay comentarios:

Publicar un comentario