Creating custom ribbon contextual groups
for SharePoint 2010 and SharePoint 2013
Ribbon Designer Add-in Express Home > Ribbon Designer for SharePoint and Office 365 > Online Guide > Ribbon controls in detail Ribbon controls in detail
Creating and showing ribbon contextual groupsIn the Add-in Express toolbox (see Ribbon Designer basics), click the corresponding tool button to add an ADXSPRibbonContextualGroup component onto the designer surface. You bind a Ribbon tab to a given contextual group using the tab's Context property as shown in the screenshot. To bind a contextual group to your Visual Web Part, you modify the CreateChildControls method so that it calls the ShowContextualGroup method. This is a static (Shared in VB.NET) method. We demonstrate how to use it in the code below:
In the code above, the ShowContextualGroup method specifies that the contextual group with the ID equal to "AdxspRibbonContextualGroup1" is shown for the web part. Ribbon control visibility rulesFor a custom Ribbon control to be visible on a page, all the conditions below must be met:
How your control is displayedFor a custom control located on a custom container control (such as custom group), you use the DisplayMode property. Say, for a custom Ribbon button, you set the DisplayMode property to one of the following values:
Using any of these values implies that you also specify an image using the Image and ImageList properties. If, however, the custom control is located on a built-in container control, you must set the DisplayModeMsp property of the custom control; the property editor suggests values appropriate for the built-in container. If you don't set a value to this property, your custom control located on a built-in container control will not show up, pay attention to Ribbon control visibility rules and Dealing with built-in Ribbon controls. |