Getting Started with WPF Spreadsheet
This article explains how to add a RadSpreadsheet control to a page in your application.
It contains the following sections:
Assembly References
The assemblies that contain the implementation of RadSpreadsheet and must be referenced in order to use the control are:
Telerik.Windows.Controls.dll
Telerik.Windows.Controls.GridView.dll
Telerik.Windows.Controls.Input.dll
Telerik.Windows.Controls.Navigation.dll
Telerik.Windows.Controls.Spreadsheet.dll
Telerik.Windows.Data.dll
Telerik.Windows.Documents.Core.dll
Telerik.Windows.Documents.Spreadsheet.dll
For export and import to XLSX:
Telerik.Windows.Zip.dll
Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.dll
To export a document to PDF, you will need to add a reference to the corresponding assembly:
- Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.dll
Note that in order to import/export in XLSX or export to PDF, the format provider must be registered manually. More information on Import/Export can be found here.
If you want to use the sample UI provided in our demos you should add this reference as well:
- Telerik.Windows.Controls.RibbonView.dll
- Telerik.Windows.Controls.SpreadsheetUI.dll
Adding Telerik Assemblies Using NuGet
To use RadSpreadsheet when working with NuGet packages, install the Telerik.Windows.Controls.Spreadsheet.for.Wpf.Xaml
package. The package name may vary slightly based on the Telerik dlls set - Xaml or NoXaml
Read more about NuGet installation in the Installing UI for WPF from NuGet Package article.
Namespaces
For a bare-bone Spreadsheet control, you only need a declaration of the telerik schema:
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
For the UI that enables the full-featured use of the control, you should also declare:
xmlns:spreadsheetControls="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Controls;assembly=Telerik.Windows.Controls.Spreadsheet"
xmlns:spreadsheet="clr-namespace:Telerik.Windows.Controls.Spreadsheet;assembly=Telerik.Windows.Controls.Spreadsheet"
Then, all that is left is to add the Spreadsheet component to the page:
<telerik:RadSpreadsheet x:Name="radSpreadsheet" />
Spreadsheet and RibbonView
RadSpreadsheet is easy to integrate with all kinds of UI thanks to the commanding mechanism that it employs. If you would like to use the control with a RadRibbonView, which shows the full potential of the control, you can refer to the Spreadsheet UI topic that describes how you can take advantage of RadSpreadsheetRibbon.
Open/Save Documents
To open a document, you need to import it and the export functionalities will help you to save one. To work with documents of the formats supported by RadSpreadsheet, you should use the format provider classes. For more information on the matter, please check the Import/Export topic.
Telerik UI for WPF Learning Resources
- Telerik UI for WPF Spreadsheet Component
- Getting Started with Telerik UI for WPF Components
- Telerik UI for WPF Installation
- Telerik UI for WPF and WinForms Integration
- Telerik UI for WPF Visual Studio Templates
- Setting a Theme with Telerik UI for WPF
- Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)
- Telerik UI for WPF License Agreement