SpreadsheetControl.AddToolbarToMenuManager(SpreadsheetToolbarType) Method

Adds the specified ribbon tabs/bar groups to the existing ribbon or toolbar menu.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v21.1.dll


public void AddToolbarToMenuManager(
    SpreadsheetToolbarType toolbarType


Name Type Description
toolbarType SpreadsheetToolbarType

The SpreadsheetToolbarType enumeration members that specify ribbon tabs/toolbars to add to the control.


Use the AddToolbarToMenuManager method to add a new tab or bar group to the existing ribbon or toolbar menu. If the SpreadsheetControl doesn’t have a RibbonControl or BarManager associated with it, the InvalidOperationException exception occurs. Use the CreateRibbon or CreateBars method to provide a ribbon or bar UI for the SpreadsheetControl at runtime.

The following code shows how to display a ribbon for the SpreadsheetControl, and use the AddToolbarToMenuManager method to add the Mail Merge tab to the created ribbon:

using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraSpreadsheet;
// ...

public Form1()

    // Create the Spreadsheet's ribbon menu.
    RibbonControl ribbon = spreadsheetControl1.CreateRibbon();
    // Add the Mail Merge tab to the ribbon.
    // Specify the active tab.
    ribbon.SelectedPage = ribbon.Pages["Home"];
See Also