C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Programmatically Customize The Ribbon
WhatsApp
Abhay Shanker
11y
9
k
0
0
25
Blog
The below mentioned codes explains the methods of customizing the ribbon in SharePoint, programmatically.
Hide a Ribbon
public
void
HideRibbon()
{
SPRibbon spRibbon = SPRibbon.GetCurrent(
this
.Page);
if
(SPRibbon !=
null
&& !
this
.Page.Request.IsAuthenticated)
{
SPRibbon.CommandUIVisible =
false
;
}
}
Hide a Ribbon Group
SPRibbon spRibbon = SPRibbon.GetCurrent(
this
.Page);
if
(spRibbon !=
null
)
{
spRibbon.TrimById(“RibbonGroupId”);
}
Hide a single ribbon button
public
void
HideRibbonItem()
{
SPRibbon spRibbon = SPRibbon.GetCurrent(
this
);
spRibbon.TrimById(
"Ribbon.ListItem.New.NewFolder"
);
}
People also reading
Membership not found