SpreadsheetControl.CreateRibbon() Method
Creates a RibbonControl with all SpreadsheetControl-specific ribbon tabs.
Namespace: DevExpress.XtraSpreadsheet
Assembly: DevExpress.XtraSpreadsheet.v24.2.dll
Declaration
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).
You can also use the CreateBars method to add a toolbar menu to the SpreadsheetControl.