Skip to main content

Create a Simple Spreadsheet Application

  • 5 minutes to read

This document describes how to use the WPF Spreadsheet control to create a simple spreadsheet application.

Install the WPF Spreadsheet Component

You can use one of the following approaches to add the WPF Spreadsheet control to the toolbox:

Use the Unified Component Installer

The Unifier Component Installer allows you to install a trial or registered version of DevExpress .NET Framework, .NET Core 3, and .NET 5 components and libraries. Refer to the following topic for information on how to use the installer: Download the Unified Component Installer.

Use a NuGet Feed

If you use a NuGet feed instead of the Unified Component Installer to add the DevExpress products, the toolbox does not contain DevExpress controls until you add the required NuGet package.

Refer to the following section for instructions on how to obtain and install NuGet packages that contain DevExpress products for .NET Framework, .NET Core, and .NET 5: Install DevExpress Controls Using NuGet Packages.

After you access DevExpress NuGet packages and register the DevExpress NuGet feed, install the DevExpress.Wpf.Spreadsheet NuGet package as follows: go to Tools | NuGet Package Manager | Manage NuGet Packages for Solution, select the DevExpress NuGet feed as a package source, and install the DevExpress.Wpf.Spreadsheet NuGet package to add the Spreadsheet control to the toolbox.

Add the Spreadsheet NuGet Package

Create a New Spreadsheet Application

Create a new WPF Application and open the MainWindow.xaml file in the Visual Studio Designer.

Drag the SpreadsheetControl item from the DX.23.1: Spreadsheet toolbox tab onto the canvas.

Drag the Spreadsheet Control from the Toolbox

Reset the Spreadsheet control’s layout to fill the entire window. Right-click the control and select Layout | Reset All in the context menu.

After this, your XAML appears as follows:

<Window x:Class="WpfSpreadsheet.MainWindow"
        Title="MainWindow" Height="350" Width="525">
        <dxsps:SpreadsheetControl CommandBarStyle="Ribbon" 

If you create a .NET Framework application and do not install NuGet packages that contain DevExpress products, you can overwrite the MainWindow.xaml file with the code above to add the Spreadsheet control to your application. In this case, add references to the following libraries:

  • DevExpress.Charts.v23.1.Core.dll
  • DevExpress.Data.v23.1.dll
  • DevExpress.DataVisualization.v23.1.Core.dll
  • DevExpress.Drawing.v23.1.dll
  • DevExpress.Images.v23.1.dll
  • DevExpress.Data.Desktop.v23.1.dll
  • DevExpress.Mvvm.v23.1.dll
  • DevExpress.Office.v23.1.Core.dll
  • DevExpress.Printing.v23.1.Core.dll
  • DevExpress.Spreadsheet.v23.1.Core.dll
  • DevExpress.TreeMap.v23.1.Core.dll
  • DevExpress.Xpf.Charts.v23.1.dll
  • DevExpress.Xpf.Core.v23.1.dll
  • DevExpress.Xpf.Docking.v23.1.dll
  • DevExpress.Xpf.NavBar.v23.1.dll
  • DevExpress.Xpf.Office.v23.1.dll
  • DevExpress.Xpf.Printing.v23.1.dll
  • DevExpress.Xpf.Ribbon.v23.1.dll
  • DevExpress.Xpf.Spreadsheet.v23.1.dll
  • DevExpress.Xpf.TreeMap.23.1.dll
  • DevExpress.Xpf.Themes.Office2019Colorful.v21.2.dll

To add references, right-click the Dependencies node in the Solution Explorer and select Add Project Reference… in the invoked context menu. Refer to the following article for a full list of required assemblies: Redistribution and Deployment.

Add Reference

Manage the Integrated Ribbon, Formula Bar, and Status Bar

The newly created WPF Spreadsheet application includes the integrated Ribbon UI, Formula Bar, and Status Bar. You can remove them in the following ways:

At Design Time

If you do not need the integrated Ribbon UI, Formula Bar, and Status Bar, select Empty from the CommandBarStyle drop-down list, and clear the ShowFormulaBar and ShowStatusBar checkboxes in the Quick Actions menu.

Remove Integrated Elements


To remove the integrated Ribbon UI, Formula Bar, and Status Bar in XAML, assign the SpreadsheetControl.CommandBarStyle property to CommandBarStyle.Empty, and set the SpreadsheetControl.ShowFormulaBar and SpreadsheetControl.ShowStatusBar properties to False or remove these properties from the markup.

        <dxsps:SpreadsheetControl CommandBarStyle="Empty" 
                                  ShowStatusBar="False" />

Load a Document

Use the SpreadsheetControl.DocumentSource property to load a document into the Spreadsheet control. You can load documents from a stream, byte array, full file path, or URI. An empty document is created if the SpreadsheetControl.DocumentSource property is null.

The example below uses a pack URI as the document source. A workbook is added to the root of the project as a resource file.

Load a Document

    <dxsps:SpreadsheetControl CommandBarStyle="Ribbon"

Change the Application’s Appearance

Click the Window’s Quick Actions and select the Convert to ThemedWindow task to convert the Window to a ThemedWindow.

Convert to Themed Window

Change the Application’s Theme

To apply the default Office2019Colorful theme to the WPF Spreadsheet application, deploy the DevExpress.Xpf.Themes.Office2019Colorful.v23.1.dll library to the client machine.

Alternatively, you can install a NuGet package that contains the required application theme (for example, DevExpress.Wpf.Themes.Office2019White). To access all available themes, install the DevExpress.Wpf.Themes.All NuGet package.

Refer to this topic for a list of available DevExpress WPF Themes: Theme List

Do one of the following to apply a different theme to your application:

  • Invoke the main window’s Quick Actions, and select a theme from the Application Theme drop-down menu.


  • In code, set the ApplicationThemeHelper.ApplicationThemeName property to a theme name at the application’s startup:

    public partial class App : Application {
        protected override void OnStartup(StartupEventArgs e) {
            DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName = "Office2019White";
  • Use the ThemeManager.ThemeName property to apply a theme to the SpreadsheetControl’s container (for example, window):

    <dx:ThemedWindow ...

Use Bitmap or Vector Icons

The WPF Spreadsheet application with an integrated ribbon uses vector icons to ensure the application is rendered correctly on high-DPI devices.

Set the static ApplicationThemeHelper.UseDefaultSvgImages property to false at application startup to use bitmap icons instead:

using System.Windows;
using DevExpress.Xpf.Core;

public partial class App : Application {
    protected override void OnStartup(StartupEventArgs e) {
        ApplicationThemeHelper.UseDefaultSvgImages = false;

Use the SpreadsheetControl.UseDefaultSvgImages property to disable SVG icons in the Spreadsheet control’s UI only. This option has priority over the ApplicationThemeHelper.UseDefaultSvgImages property.

<dxsps:SpreadsheetControl CommandBarStyle="Ribbon" UseDefaultSvgImages ="False" ShowFormulaBar="True"/>

The following images illustrate the standard WPF Spreadsheet‘s ribbon UI with default vector and bitmap icons.

  • SVG Icons


  • Bitmap Icons


See Also