IXlRow.CreateCell() Method
Creates a new cell in the row and returns the IXlCell object.
Namespace: DevExpress.Export.Xl
Assembly: DevExpress.Printing.v20.1.Core.dll
NuGet Packages: DevExpress.Printing.Core, DevExpress.WindowsDesktop.Printing.Core
Declaration
Returns
Type | Description |
---|---|
IXlCell | An IXlCell object that is the newly created cell. |
Example
The example below demonstrates how to create worksheet cells and set their values. To add data to a cell, assign the required value to the IXlCell.Value property.
// Create a new worksheet.
using (IXlSheet sheet = document.CreateSheet()) {
// Create the first row in a worksheet.
using (IXlRow row = sheet.CreateRow()) {
// Create the cell A1 and specify its value.
using (IXlCell cell = row.CreateCell()) {
cell.Value = "Numeric value:";
}
// Create the cell B1 and specify its value.
using (IXlCell cell = row.CreateCell()) {
cell.Value = 123.45;
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateCell() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.