Modify Documents in Code
This topic describes how to modify a document in the DevExpress.Web.ASPxSpreadsheet.
Follow the steps below to modify a document on the server side:
Call the client PerformCallback method to initiate a callback to the server side to access the document model.
First, use the Document property to obtain an IWorkbook. This interface encapsulates the spreadsheet document API.
IWorkbook workbook = ASPxSpreadsheet1.Document;
Use the following APIs to access a worksheet:
The Worksheets property - Provides access to a worksheet by its index:
Worksheet worksheet = workbook.Worksheets;
The ActiveWorksheet property - Provides access to an active worksheet:
Worksheet worksheet = workbook.Worksheets.ActiveWorksheet;
You should reference the DevExpress.Office.20.2.Core assembly.
Range rangeA1B5 = worksheet["A1:B5"];