IXlSheet.CreateRow(Int32) Method

Creates a new row in the worksheet with the specified index.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v21.2.Core.dll


IXlRow CreateRow(
    int rowIndex


Name Type Description
rowIndex 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.


Type Description

An IXlRow object that is the newly created row.


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;
See Also