TableRowCollection Class
Represents a collection of Table rows, not including header and, if enabled, totals row. Supported in XLSX only.
public sealed class TableRowCollection : IEnumerable<TableRow>, IEnumerable
Public NotInheritable Class TableRowCollection
Implements IEnumerable(Of TableRow), IEnumerable
- Inheritance:
- System.ObjectTableRowCollection
Properties
Count
Gets the number of rows contained in the table, not including the header row and, if enabled, totals row.
Property Value
- System.Int32
The number of rows contained in the table.
Item[Int32]
Gets the TableRow at the specified index.
public TableRow this[int index] { get; }
Public ReadOnly Property Item(index As Integer) As TableRow
Parameters
index
- System.Int32
The zero-based index of the TableRow.
Property Value
Methods
Add()
Adds a new TableRow.
Returns
Add(Int32)
Adds the specified number of new TableRows.
public IEnumerable<TableRow> Add(int count)
Public Function Add(count As Integer) As IEnumerable(Of TableRow)
Parameters
count
- System.Int32
The number of TableRows to add.
Returns
Add(Object[])
Adds a new TableRow with the specified cell values.
public TableRow Add(object[] cellValues)
Public Function Add(cellValues As Object()) As TableRow
Parameters
cellValues
- System.Object[]
The values for row's cells.
Returns
GetEnumerator()
Gets the collection enumerator.
public IEnumerator<TableRow> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of TableRow)
Returns
- System.Collections.Generic.IEnumerator<TableRow>
The collection enumerator.
Insert(Int32)
Inserts a new TableRow at the specified index.
Parameters
index
- System.Int32
The row index.
Returns
Exceptions
- System.ArgumentOutOfRangeException
index
is out of range.
Insert(Int32, Int32)
Inserts the specified number of new TableRows at the specified index.
public IEnumerable<TableRow> Insert(int index, int count)
Public Function Insert(index As Integer, count As Integer) As IEnumerable(Of TableRow)
Parameters
index
- System.Int32
The row index.
count
- System.Int32
The number of rows to insert.
Returns
Exceptions
- System.ArgumentOutOfRangeException
index
is out of range or count
is less than 1.
Insert(Int32, Object[])
Inserts a new TableRow with the specified cell values.
public TableRow Insert(int index, object[] cellValues)
Public Function Insert(index As Integer, cellValues As Object()) As TableRow
Parameters
index
- System.Int32
The row index.
cellValues
- System.Object[]
The values for row's cells.
Returns
Exceptions
- System.ArgumentOutOfRangeException
index
is out of range.
Remove(TableRow)
Removes the specified TableRow.
Parameters
row
- TableRow
The table row.
Returns
- System.Boolean
true if TableRow was removed from the collection; otherwise, false.
Exceptions
- System.ArgumentNullException
row
is null.
RemoveAt(Int32)
Removes the row at the specified index.
Parameters
index
- System.Int32
The row index.
Exceptions
- System.ArgumentOutOfRangeException
index
is out of range.
RemoveAt(Int32, Int32)
Removes the specified number of rows at the specified index.
public void RemoveAt(int index, int count)
Public Sub RemoveAt(index As Integer, count As Integer)
Parameters
index
- System.Int32
The row index.
count
- System.Int32
The number of rows to remove.
Exceptions
- System.ArgumentOutOfRangeException
index
is out of range. or count
is less than 1.