Customize the Spreadsheet Editors
- 2 minutes to read
Note
XAF does not support the Spreadsheet editor for ASP.NET Core Blazor applications.
In the Model Editor
This section shows how to use the Model Editor to customize the Spreadsheet Property Editor in a WinForms project.
Show or Hide the Formula Bar
The SpreadsheetPropertyEditor displays the Spreadsheet control with a Formula Bar (WinForms).
In the Model Editor, navigate to the Views | <DetailView> | Items | <PropertyEditor> node and specify the EnableFormulaBar property to show or hide the Formula Bar.

Specify MenuManagerType for a Detail View
Note that the SpreadsheetPropertyEditor menu manager contains a Ribbon Control or Barsd.
Navigate to the Views | <DetailView> | Items | <PropertyEditor> node and set the editor’s MenuManagerType.

In Code
Change the Document Storage Format
In the WinForms application project and ASP.NET Web Forms Module project, create a View Controller.
In the overridden
OnActivatedmethod, access theSpreadsheetPropertyEditoras described in the Ways to Access UI Elements and Their Controls topic.Specify the editor’s
DocumentFormatproperty.using DevExpress.ExpressApp; using DevExpress.ExpressApp.Office.Win; using DevExpress.Spreadsheet; // ... public class SpreadsheetDocumentFormatController : ObjectViewController<DetailView, Document> { protected override void OnActivated() { base.OnActivated(); SpreadsheetPropertyEditor spreadsheetPropertyEditor = View.FindItem("Data") as SpreadsheetPropertyEditor; if (spreadsheetPropertyEditor != null) { spreadsheetPropertyEditor.DocumentFormat = DocumentFormat.OpenXml; } } }
Customize the WinForms SpreadsheetPropertyEditor Menu
The SpreadsheetPropertyEditor menu does not display all available toolbars and ribbon tabs. Use the static SpreadsheetPropertyEditor.DefaultSpreadsheetToolbarType property to customize toolbars. The available items are listed in the SpreadsheetToolbarType enumeration.
using DevExpress.ExpressApp.Office.Win;
using DevExpress.XtraSpreadsheet;
// ...
SpreadsheetPropertyEditor.DefaultSpreadsheetToolbarType |=
SpreadsheetToolbarType.ChartTools | SpreadsheetToolbarType.TableTools;
Handle the SpreadsheetMenuManagerController.CustomizeSpreadsheetToolbarType event to change the toolbars and tabs for a specific editor only:
In the WinForms Module project, create a View Controller. If your solution does not contain this project, add the Controller to the WinForms application project.
Access the
SpreadsheetMenuManagerControllerand subscribe to itsCustomizeSpreadsheetToolbarTypeevent in the overriddenOnActivatedmethod.In the event handler, specify the
CustomizeSpreadsheetToolbarTypeEventArgs.SpreadsheetToolbarTypeproperty.
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Office.Win;
using DevExpress.XtraSpreadsheet;
// ...
public class CustomSpreadsheetController : ViewController {
protected override void OnActivated() {
base.OnActivated();
SpreadsheetMenuManagerController controller = Frame.GetController<SpreadsheetMenuManagerController>();
if (controller != null) {
controller.CustomizeSpreadsheetToolbarType += Controller_CustomizeSpreadsheetToolbarType;
}
}
private void Controller_CustomizeSpreadsheetToolbarType(object sender, CustomizeSpreadsheetToolbarTypeEventArgs e) {
e.SpreadsheetToolbarType |= SpreadsheetToolbarType.ChartTools | SpreadsheetToolbarType.TableTools;
}
}
You can also customize the Bars menu at runtime. Your customizations are stored in the user’s model differences.
