Getting Started with WinForms Spreadsheet
This tutorial will help you to quickly get started using the control.
Adding Telerik Assemblies Using NuGet
To use RadSpreadsheet
when working with NuGet packages, install the Telerik.UI.for.WinForms.AllControls
package. The package target framework version may vary.
Read more about NuGet installation in the Install using NuGet Packages article.
With the 2025 Q1 release, the Telerik UI for WinForms has a new licensing mechanism. You can learn more about it here.
Adding Assembly References Manually
When dragging and dropping a control from the Visual Studio (VS) Toolbox onto the Form Designer, VS automatically adds the necessary assemblies. However, if you're adding the control programmatically, you'll need to manually reference the following assemblies:
- Telerik.Licensing.Runtime
- Telerik.WinControls
- Telerik.WinControls.ChartView
- Telerik.WinControls.GridView
- Telerik.WinControls.RadSpreadsheet
- Telerik.WinControls.UI
- Telerik.Windows.Documents.Core
- Telerik.Windows.Documents.Spreadsheet
- Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml
- Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf
- Telerik.Windows.Documents.Spreadsheet.FormatProviders.Xls
- TelerikCommon
The Telerik UI for WinForms assemblies can be install by using one of the available installation approaches.
Defining the RadSpreadsheet
This section explains how to add a RadSpreadsheet control to a form and wire it with UI.
Now add the RadSpreadsheet control to the form. After that add RadSpreadsheetRibbonBar to the form. Dock it to the top and then Dock the RadSpreadsheet to fill the remaining space. Your layout should look like this.
Open the Smart Tag of the ribbon and set the associated control.
That is all. You are ready to start the application and examine the control features.
Programmatically loading documents
In some cases you may need to load the document in the code behind, not by using the UI. The following snippet demonstrates how you can load the document directly from file.
Load document with code.
string fileName = @"C:\Test.xlsx";
var formatProvider = new XlsxFormatProvider();
using (Stream input = new FileStream(fileName, FileMode.Open))
{
radSpreadsheet1.Workbook = formatProvider.Import(input);
}
Dim fileName As String = "C:\Test.xlsx"
Dim formatProvider = New XlsxFormatProvider()
Using input As Stream = New FileStream(fileName, FileMode.Open)
radSpreadsheet1.Workbook = formatProvider.Import(input)
End Using
Detailed information about the format providers is available here.
See Also
Telerik UI for WinForms Learning Resources
- Telerik UI for WinForms Spreadsheet Component
- Getting Started with Telerik UI for WinForms Components
- Telerik UI for WinForms Setup
- Telerik UI for WinForms Application Modernization
- Telerik UI for WinForms Visual Studio Templates
- Deploy Telerik UI for WinForms Applications
- Telerik UI for WinForms Virtual Classroom(Training Courses for Registered Users)
- Telerik UI for WinForms License Agreement)