czwartek, 10 kwietnia 2014

How to hide Ribbon items

The Ribbon on the SharePoint Forms supports customization of the default tabs, groups, and controls.
In order to customize Ribbon item, you need to know the specific identifier (ID).
The IDs can be found in the CMDUI.xml file in the …\14\TEMPLATE\GLOBAL\XML directory or you can see them here: http://msdn.microsoft.com/en-us/library/ee537543.aspx
Here is the example of how to hide some ribbon items in the form’s code-behind:
protected void Page_Load(object sender, EventArgs e)
{
  SPRibbon rib = SPRibbon.GetCurrent(this);
  if (rib != null)
  {
    rib.TrimById("Ribbon.ListForm.Edit.Actions.DeleteItem");
    rib.TrimById("Ribbon.ListForm.Edit.Actions.EditSeries");
    rib.TrimById("Ribbon.ListForm.Edit.Actions.ClaimReleaseTask");
    rib.TrimById("Ribbon.ListForm.Edit.Actions.DistributionListsApproval");       
  }
}

Brak komentarzy:

Prześlij komentarz