IXlSheet.CreateRow(Int32) Method
Creates a new row in the worksheet with the specified index.
Namespace: DevExpress.Export.Xl
Assembly: DevExpress.Printing.v24.2.Core.dll
NuGet Package: DevExpress.Printing.Core
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
row |
Int32 | An integer specifying the zero-based index of the created row. If it is negative or exceeds the last available index, an exception is raised. |
#Returns
Type | Description |
---|---|
IXl |
An IXl |
#Remarks
Note
When you finish working with the IXl
object, call the Dispose method to release all the resources used by the object. Otherwise, generated content is not written to the output file. You can also modify the IXl
object within the using statement (Using block in Visual Basic).
#Example
The example below demonstrates how to create and modify a row in a worksheet. To do this, use the IXlSheet.CreateRow method. To specify where a created row should be located in a worksheet, pass a zero-based row index to the method as a parameter.
// Create a new worksheet.
using (IXlSheet sheet = document.CreateSheet())
{
// Create the third row and set its height to 40 pixels.
using (IXlRow row = sheet.CreateRow(2))
{
row.HeightInPixels = 40;
}
}
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateRow(Int32) 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.