Back to Devexpress

SpreadsheetControl.CommandBarStyle Property

wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-b1d53c01.md

latest5.7 KB
Original Source

SpreadsheetControl.CommandBarStyle Property

Gets or sets the command bar for the SpreadsheetControl. This is a dependency property.

Namespace : DevExpress.Xpf.Spreadsheet

Assembly : DevExpress.Xpf.Spreadsheet.v25.2.dll

NuGet Package : DevExpress.Wpf.Spreadsheet

Declaration

csharp
public CommandBarStyle CommandBarStyle { get; set; }
vb
Public Property CommandBarStyle As CommandBarStyle

Property Value

TypeDescription
CommandBarStyle

A CommandBarStyle enumeration value.

|

Available values:

NameDescription
Empty

The SpreadsheetControl does not display an integrated ribbon.

| | Ribbon |

The SpreadsheetControl displays an integrated ribbon.

|

Remarks

Use the CommandBarStyle property to show or hide the integrated ribbon UI for the SpreadsheetControl. When you create a new WPF Spreadsheet application, it displays the integrated ribbon with all the available spreadsheet ribbon pages by default. You can customize the integrated ribbon by adding new ribbon elements, modifying or removing the existing items. For an example, refer to the Customize the Integrated Ribbon UI for the Spreadsheet tutorial.

If you do not require the integrated ribbon, remove it by setting the CommandBarStyle property to CommandBarStyle.Empty.

Note

The SpreadsheetControl.Ribbon property does not return the ribbon menu specified by the CommandBarStyle property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CommandBarStyle property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-how-to-create-a-custom-message-box-service/CS/WpfSpreadsheet_MessageBoxService/MainWindow.xaml#L10

xml
<Grid>
    <dxsps:SpreadsheetControl x:Name="spreadsheet" CommandBarStyle="Ribbon" ShowFormulaBar="True" Loaded="spreadsheet_Loaded"
                              DocumentSource="pack://application:,,,/WpfSpreadsheet_MessageBoxService;component/Document.xlsx"/>

wpf-spreadsheet-how-to-replace-standard-command-with-custom-command/CS/WpfSpreadsheet_CustomCommand/MainWindow.xaml#L9

xml
<Grid>
    <dxsps:SpreadsheetControl x:Name="spreadsheetControl" CommandBarStyle="Ribbon" ShowFormulaBar="True" Loaded="spreadsheetControl_Loaded"
                              DocumentSource="pack://application:,,,/WpfSpreadsheet_CustomCommand;component/Document.xlsx"/>

wpf-spreadsheet-create-custom-progress-indicator/CS/WpfSpreadsheetProgressSample/MainWindow.xaml#L17

xml
<dxsps:SpreadsheetControl x:Name="spreadsheetControl1"
                          CommandBarStyle="Ribbon"
                          ShowFormulaBar="True"

wpf-spreadsheet-spell-check-cell-text/CS/MainWindow.xaml#L11

xml
<Grid>
    <dxsps:SpreadsheetControl x:Name="spreadsheetControl" CommandBarStyle="Ribbon"
                              ShowFormulaBar="True" ShowStatusBar="True"

wpf-spreadsheet-assign-custom-in-place-editors/CS/WpfSpreadsheet_CustomCellEditors/MainWindow.xaml#L11

xml
<Grid>
    <dxsps:SpreadsheetControl x:Name="spreadsheetControl" CommandBarStyle="Ribbon" ShowFormulaBar="True" ShowStatusBar="True" />
</Grid>

See Also

Create a Simple Spreadsheet Application

Customize the Integrated Ribbon UI for the Spreadsheet

SpreadsheetControl Class

SpreadsheetControl Members

DevExpress.Xpf.Spreadsheet Namespace