SpreadsheetControl Class
Emulates the Microsoft® Excel® look and feel and allows you to create, load, edit, save and print spreadsheet documents.
Namespace: DevExpress.Xpf.Spreadsheet
Assembly: DevExpress.Xpf.Spreadsheet.v24.2.dll
NuGet Package: DevExpress.Wpf.Spreadsheet
Declaration
public class SpreadsheetControl :
Control,
IGestureClient,
IMouseWheelScrollClient,
IToolTipControlClient,
IWin32Window,
IDisposable,
ILogicalOwner,
IInputElement,
IOfficeFontSizeProvider,
ISpreadsheetDocumentServer,
IBatchUpdateable,
IServiceContainer,
IServiceProvider,
ISpreadsheetControl,
ISpreadsheetComponent,
ISupportsContentChanged,
ICommandAwareControl<SpreadsheetCommandId>,
IInnerSpreadsheetControlOwner,
IInnerSpreadsheetDocumentServerOwner,
IDpiProvider,
INotifyPropertyChanged
Related API Members
The following members return SpreadsheetControl objects:
Remarks
The SpreadsheetControl class specifies a visual control to create, load, modify, print, save and convert spreadsheet documents in different formats.
A document loaded into the spreadsheet control is a workbook that exposes the IWorkbook interface and is accessible using the SpreadsheetControl.Document property. The IWorkbook interface provides a comprehensive set of properties and methods to manipulate worksheets, rows, columns and cells of the corresponding workbook. See the Examples section for details.
The SpreadsheetControl’s automated formula calculation engine allows you to perform complex calculations using various functions and cell references and create shared and array formulas. You can also create your own custom functions to add to the built-in functions for use in formulas.
The SpreadsheetControl provides a set of tools to format worksheet cells, support defined names, tables, pivot tables, charts, pictures and shapes, and introduces the mail merge mechanism.
The SpreadsheetControl.Options property provides access to the SpreadsheetControlOptions object that stores settings specific to the SpreadsheetControl. Use the SpreadsheetControlOptions.Behavior property to apply restrictions to different spreadsheet operations (such as creating, loading, modifying and printing workbooks). The SpreadsheetControlOptions.Print options allow you to control how to generate and preview a printed document. The SpreadsheetControlOptions.View options specify the SpreadsheetControl’s display settings.
Refer to the Visual Elements section for information on the SpreadsheetControl user interface and built-in dialogs.
The code sample below creates a SpreadsheetControl with a ribbon UI and formula bar in XAML and loads an xlsx file:
<Window x:Class="WpfSpreadsheet.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxsps="http://schemas.devexpress.com/winfx/2008/xaml/spreadsheet"
Title="MainWindow" Height="350" Width="525">
<Grid>
<dxsps:SpreadsheetControl CommandBarStyle="Ribbon"
ShowFormulaBar="True"
DocumentSource="pack://application:,,,/WpfSpreadsheet;component/Document.xlsx"/>
</Grid>
</Window>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the SpreadsheetControl class.
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.