Skip to main content
Row

WorksheetExtensions Class

Defines extension methods for the Worksheet interface.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use these methods in production code.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Docs.v24.2.dll

NuGet Package: DevExpress.Document.Processor

Declaration

public static class WorksheetExtensions

Remarks

To enable worksheet extensions, add a reference to the DevExpress.Docs.v24.2.dll assembly and explicitly import the DevExpress.Spreadsheet namespace into the code with the using directive (Imports in Visual Basic).

You can call extension methods in the same way as instance methods of the Worksheet object.

The example below shows how to use the Import extension method to insert data from a list into a worksheet.

using DevExpress.Spreadsheet;
using System.Collections.Generic;
//...

Worksheet worksheet = workbook.Worksheets[0];

// Create a list that contains string values.
List<string> cities = new List<string>();
cities.Add("New York");
cities.Add("Rome");
cities.Add("Beijing");
cities.Add("Delhi");

// Insert list values into the worksheet vertically.
// Data starts with the B1 cell.
worksheet.Import(cities, 0, 1, true);

Refer to the Import and Export Data section for more examples on how to use the WorksheetExtensions methods to import data into a worksheet or export data from a worksheet to a data table.

Inheritance

Object
WorksheetExtensions
See Also