Skip to content

Class ExcelTableRowCollection

Namespace: OfficeOpenXml.Table
Assembly: EPPlus.dll

A collection of ExcelTableRows.

public class ExcelTableRowCollection : IEnumerable<ExcelTableRow>, IEnumerable

Inheritance

object ← ExcelTableRowCollection

Implements

IEnumerable
IEnumerable<ExcelTableRow>

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Properties

this[int]

Returns a table row

public ExcelTableRow this[int ix] { get; }

Property Value

ExcelTableRow

Methods

AddNewRow(bool)

Add a new empty row at the bottom the table.

public ExcelTableRow AddNewRow(bool copyStyles = true)

Parameters

copyStyles bool

Indicates whether styles should be copied to the new row. Default is true.

Returns

ExcelTableRow

The added ExcelTableRow

AddNewRows(int, bool)

Add a number of new empty rows at the bottom the table.

public IEnumerable<ExcelTableRow> AddNewRows(int nRows, bool copyStyles = true)

Parameters

nRows int

Number of rows to add

copyStyles bool

Indicates whether styles should be copied to the new row. Default is true.

Returns

IEnumerable<ExcelTableRow>

The added rows

Clear()

Clears/deletes all data in the table's rows.

public void Clear()

DeleteRows(int, int)

Deletes the specified number of rows at the given position in the table

public void DeleteRows(int position, int numberOfRows = 1)

Parameters

position int

0-based position of the deletion

numberOfRows int

Number of rows to delete

GetEnumerator()

Returns an iterator

public IEnumerator<ExcelTableRow> GetEnumerator()

Returns

IEnumerator<ExcelTableRow>

InsertNewRow(int, bool)

Inserts a new empty row at the specified position.

public ExcelTableRow InsertNewRow(int position, bool copyStyles = true)

Parameters

position int

0-based position where the new row should be added

copyStyles bool

Indicates whether styles should be copied to the new row. Default is true.

Returns

ExcelTableRow

InsertNewRows(int, int, bool)

Inserts one or more new empty rows at the specified position.

public IEnumerable<ExcelTableRow> InsertNewRows(int position, int nRows = 1, bool copyStyles = true)

Parameters

position int

0-based position where the new rows should be added

nRows int

Number of new rows to insert

copyStyles bool

Indicates whether styles should be copied to the new row. Default is true.

Returns

IEnumerable<ExcelTableRow>