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.CreateBars(SpreadsheetToolbarType) Method

Adds a BarManager with the specified bars to the SpreadsheetControl.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v24.2.dll

NuGet Package: DevExpress.Win.Spreadsheet

#Declaration

public BarManager CreateBars(
    SpreadsheetToolbarType toolbarType
)

#Parameters

Name Type Description
toolbarType SpreadsheetToolbarType

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

#Returns

Type Description
BarManager

A component that manages the created toolbars.

#Remarks

Use the CreateBars method overloads to create a toolbar menu that allows end users to perform basic operations in the SpreadsheetControl.

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

public Form1()
{
    InitializeComponent();

    // Create all available spreadsheet toolbars.
    BarManager bars = spreadsheetControl1.CreateBars(SpreadsheetToolbarType.All | SpreadsheetToolbarType.MailMerge);
    bars.Form = this;
}

To create a toolbar menu at design time, select the Create BarManager item in the SpreadsheetControl’s smart tag menu.

SpreadsheetControl_CreateBars

You can also use the CreateRibbon method to provide the modern ribbon interface for the SpreadsheetControl.

See Also