SpreadsheetControl.CreateRibbon(SpreadsheetToolbarType) Method
Adds a RibbonControl with the specified tabs to the SpreadsheetControl.
Namespace: DevExpress.XtraSpreadsheet
Assembly: DevExpress.XtraSpreadsheet.v19.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
toolbarType | SpreadsheetToolbarType | The SpreadsheetToolbarType enumeration members that specify ribbon tabs to add to the control. |
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.
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraSpreadsheet;
// ...
public Form1()
{
InitializeComponent();
// Create all available spreadsheet ribbon tabs.
RibbonControl ribbon = spreadsheetControl1.CreateRibbon(SpreadsheetToolbarType.All | 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 Getting Started for details).
You can also use the CreateBars method to add a toolbar menu to the SpreadsheetControl.
See Also