In the previous sections, we added tabs, groups, and buttons to complete the "add" operation. Here we are going to delete a button control on ribbon. It should be noted that the deletion here is actually implemented through hiding.
The procedure is as follows:
1. Use the SharePoint project created earlier
Add a new blank element in this project, as shown in figure
2. define the content of this element to delete it.
To open the elements. xml file under removeribbonbutton, the content of the file is as follows:
<? XML version = "1.0" encoding = "UTF-8" ?>
< Elements Xmlns = "Http://schemas.microsoft.com/sharepoint" >
< Customaction
ID = "Ribbon. customtabexample. cutomimggroup. removeribbonbutton"
Location = "Commandui. Ribbon"
Registrationid = "101"
Registrationtype = "List" >
< Commanduiextension >
< Commanduidefinitions >
< Commanduidefinition
Location = "Ribbon. customtabexample. cutomimggroup. customimggrouphello" />
</ Commanduidefinitions >
</ Commanduiextension >
</ Customaction >
</ Elements >
In this example, we determine that the button to be deleted is at ribbon. customtabexample. cutomimggroup. customimggrouphello (Format: [ribbon]. [Tab]. [name of the target group]. [name of the target control]), so here, location is: Location = "ribbon. customtabexample. cutomimggroup. customimggrouphello"
3. Deploy custom group items
Press F5. The SharePoint development tool in Visual Studio 2010 will automatically build and deploy functions.
Go to the document library of the website or sub-website. View the result as shown in