Version

Adding XamSpreadsheet to Your Page

Purpose

This topic provides detailed instructions to help you get up and running as soon as possible with the XamSpreadsheet.

Required background

The following table lists the concept and topics required as a prerequisite to understanding this topic.

Type Content

Concept

Infragistics Excel Engine

Topic Purpose

In this section you will find information that will help you to better understand the object model and the functionalities of the Infragistics Excel Engine.

This topic explains in details the features of the XamSpreadsheet control from developer perspective.

This topic provides an overview of the visual elements of the XamSpreadsheet control.

In this topic

This topic contains the following sections:

Adding XamSpreadsheet to Your Page

Introduction

The procedure explains step by step the operations necessary for adding the XamSpreadsheet to your page.

Overview

Following is a conceptual overview of the process:

1. Add assembly references

2. Add namespaces

3. Create XamSpreadsheet

4. Create content (alternative)

5. Load content (alternative)

6. Bind/set workbook to the XamSpreadsheet

Steps

The following steps demonstrate how to add the XamSpreadsheet to your page.

1. Add required NuGet package

Add the following NuGet package reference in your project:

  • Infragistics.WPF.Spreadsheet

For more information on setting up the NuGet feed and adding NuGet packages, you can take a look at the following documentation: NuGet Feeds.

2. Add namespaces

Add the following namespaces:

In XAML:

xmlns:ig="http://schemas.infragistics.com/xaml"

In C#:

using Infragistics.Controls.Editors;
using Infragistics.Documents.Excel;

In Visual Basic:

Imports Infragistics.Controls.Editors
Imports Infragistics.Documents.Excel

3. Create XamSpreadsheet

Create and put the XamSpreadsheet on your page:

In XAML:

<ig:XamSpreadsheet x:Name="xamSpreadsheet1">
</ig:XamSpreadsheet>

In C#:

XamSpreadsheet spreadsheet1 = new XamSpreadsheet();

In VB:

Dim spreadsheet1 As New XamSpreadsheet()

4. Create content (alternative)

Create a workbook, naming it "wb1" and add content in it as described in the Creating a Workbook (Infragistics Excel Engine) topic.

Note
Note

This step is an alternative to step 5.

5. Load content (alternative)

Load a workbook from a stream or file as described in the Loading an Excel File (Infragistics Excel Engine) topic and name the workbook "wb1".

Note
Note

This step is an alternative to step 4.

6. Bind/set workbook to the XamSpreadsheet

Set the XamSpreadsheet’s Workbook property to the workbook create in the step 4 or 5.

In C#:

this.XamSpreadsheet1.Workbook = wb1;

In Visual Basic:

Me.XamSpreadsheet1.Workbook = wb1

Related Content

The following topics provide additional information related to this topic.

Topic Purpose

This is a set of topics describing how to configure the control.

This is a set of topics describing how to work with the control from developer perspective.