GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    TableRowCollection Class

    Namespace:
    GemBox.Spreadsheet.Tables
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a collection of Table rows, not including header and, if enabled, totals row. Supported in XLSX only.

    • C#
    • VB.NET
    public sealed class TableRowCollection : IEnumerable<TableRow>, IEnumerable
    Public NotInheritable Class TableRowCollection
        Implements IEnumerable(Of TableRow), IEnumerable
    Inheritance:
    System.Object
    TableRowCollection
    Implements
    System.Collections.Generic.IEnumerable<TableRow>
    System.Collections.IEnumerable

    Properties

    Count

    Gets the number of rows contained in the table, not including the header row and, if enabled, totals row.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The number of rows contained in the table.

    Item[Int32]

    Gets the TableRow at the specified index.

    • C#
    • VB.NET
    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
    TableRow

    The TableRow.

    Methods

    Add()

    Adds a new TableRow.

    • C#
    • VB.NET
    public TableRow Add()
    Public Function Add As TableRow
    Returns
    TableRow

    Added TableRow.

    Add(Int32)

    Adds the specified number of new TableRows.

    • C#
    • VB.NET
    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
    System.Collections.Generic.IEnumerable<TableRow>

    Added TableRows.

    Add(Object[])

    Adds a new TableRow with the specified cell values.

    • C#
    • VB.NET
    public TableRow Add(object[] cellValues)
    Public Function Add(cellValues As Object()) As TableRow
    Parameters
    cellValues
    System.Object[]

    The values for row's cells.

    Returns
    TableRow

    Added TableRow.

    GetEnumerator()

    Gets the collection enumerator.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public TableRow Insert(int index)
    Public Function Insert(index As Integer) As TableRow
    Parameters
    index
    System.Int32

    The row index.

    Returns
    TableRow

    Inserted TableRow.

    Exceptions
    System.ArgumentOutOfRangeException

    index is out of range.

    Insert(Int32, Int32)

    Inserts the specified number of new TableRows at the specified index.

    • C#
    • VB.NET
    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
    System.Collections.Generic.IEnumerable<TableRow>

    Inserted TableRows.

    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.

    • C#
    • VB.NET
    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
    TableRow

    Inserted TableRow.

    Exceptions
    System.ArgumentOutOfRangeException

    index is out of range.

    Remove(TableRow)

    Removes the specified TableRow.

    • C#
    • VB.NET
    public bool Remove(TableRow row)
    Public Function Remove(row As TableRow) As Boolean
    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.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    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.

    • C#
    • VB.NET
    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.

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.