Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SpreadsheetControl.CreateRibbon() Method

Creates a RibbonControl with all SpreadsheetControl-specific ribbon tabs.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v24.2.dll

NuGet Package: DevExpress.Win.Spreadsheet

#Declaration

public RibbonControl CreateRibbon()

#Returns

Type Description
RibbonControl

The created ribbon.

#Remarks

Use the CreateRibbon method overloads to create a ribbon UI that allows end users to perform basic operations in the SpreadsheetControl. The current method creates all available spreadsheet ribbon tabs, except for the Mail Merge tab. You can use the AddToolbarToMenuManager method to add this tab to your ribbon, as shown below:

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

public Form1()
{
    InitializeComponent();

    // Create the Spreadsheet's ribbon menu.
    RibbonControl ribbon = spreadsheetControl1.CreateRibbon();
    // Add the Mail Merge tab to the ribbon.
    spreadsheetControl1.AddToolbarToMenuManager(SpreadsheetToolbarType.MailMerge);
    // Specify the active tab.
    ribbon.SelectedPage = ribbon.Pages["Home"];
    this.Controls.Add(ribbon);
}

To create a ribbon at design time, select the Create Ribbon item in the SpreadsheetControl’s smart tag menu (see Get Started with the WinForms Spreadsheet Control for details).

SpreadsheetControl_CreateRibbon

You can also use the CreateBars method to add a toolbar menu to the SpreadsheetControl.

See Also