To remove this button from the FormToolBar the following piece of code was used in the code in the ControlTemplate associated with the Custom Document Library's content type.
Control apprejButton = Utils.FindControlRecursive(this.Page, "diidIOAppDenyItem");
if (apprejButton != null)
apprejButton.Visible = false;
This uses a FindControl method that searches through all the containers on the page for the Approve/Reject button (Credit goes to Jeff Atwood's blog):
private Control FindControlRecursive(Control root, string id)
{
if (root.ID == id)
{
return root;
}
foreach (Control c in root.Controls)
{
Control t = FindControlRecursive(c, id);
if (t != null)
{
return t;
}
}
return null;
}

No comments:
Post a Comment