Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer

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

share|improve this answer
    
I know how to hide (trim) buttons, i need to reveal them, make them visible again! –  Shkipper Sep 28 '12 at 14:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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