0

My question is straight forward, how do i programmatically untrim the trimmed control on the Ribbon?

So if this happens:

 SPRibbon current = SPRibbon.GetCurrent(this.Page);
            if (current == null)
                return;
            current.TrimById("Ribbon.Read");

How do i untrim it, somewhere in the code?

How do i use method SPRibbon.TrimById(string id, string visibilityContext)?

Why makeTabAvailable() doesn't work?

2 Answers 2

1

Not possible - the SPRibbon.TrimById operation is not reversible! Refelcting the method reveals that the specified id is added to a private ArrayList in the SPRibbon class. There is no corresponding SPRibbon.UntrimById method. You will need to find a way to avoid the trimming in the first place.

0

public void HideRibbonButton()

{ //if this is a System.Web.UI.Page

SPRibbon ribbon = SPRibbon.GetCurrent(this);

ribbon.TrimById(“Ribbon.DocLibListForm.Edit.Actions.DeleteItem”);

}

Hide Groupribbon.TrimById(“Ribbon.EditingTools.CPEditTab.EditAndCheckout”);

Check Link

http://sampathnarsingam.blogspot.in/2012/05/sharepoint-2010-hide-ribbon-buttons.html

1
  • I know how to hide (trim) buttons, i need to reveal them, make them visible again!
    – Shkipper
    Sep 28, 2012 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.