Edit this page

Getting Started

This article explains how to add a RadSpreadsheet control to a form and wire it with UI.

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.WinControls.RadSpreadsheet

  • Telerik.WinControls

  • TelerikCommon

  • Telerik.WinControls.UI

  • Telerik.WinControls.GridView.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

Spreadsheet and RibbonView

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.

spreadsheet-getting-started001

Open the Smart Tag of the ribbon and set the associated control.

spreadsheet-getting-started002

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

note

Detailed information about the format providers is available here.

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy