RowCollection class

Collects the objects that represent the individual rows in a worksheet.

public class RowCollection : IEnumerable


Name Description
Count { get; } Gets the number of rows in this collection.
Item { get; } Gets a object by given row index. The Row object of given row index will be instantiated if it does not exist before.


Name Description
Clear() Clear all rows and cells.
GetEnumerator() Gets an enumerator that iterates through this collection
GetRowByIndex(int) Gets the row object by the position in the list.
RemoveAt(int) Remove the row at the specified index



//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the first worksheet
Worksheet worksheet = workbook.Worksheets[0];
 //Get first row
Row row = worksheet.Cells.Rows[0];


'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()

'Obtaining the reference of the first worksheet
Dim worksheet As Worksheet = workbook.Worksheets(0)
'Get first row
Dim row as Row = worksheet.Cells.Rows(0)

See Also