Class RowCollection

RowCollection class

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

public class RowCollection : IEnumerable

Properties

NameDescription
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.

Methods

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

Examples


[C#]

//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];

[VB.NET]

'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