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

    Show / Hide Table of Contents

    TableCollection Class

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

    A collection of Table items. Supported in XLSX only.

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

    Properties

    Count

    Gets the number of Tables contained in the collection.

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

    The number of Tables contained in the collection.

    Item[Int32]

    Gets the Table at the specified index.

    • C#
    • VB.NET
    public Table this[int index] { get; }
    Public ReadOnly Property Item(index As Integer) As Table
    Parameters
    index
    System.Int32

    The zero-based index of the Table.

    Property Value
    Table

    The Table at the specified index.

    Item[String]

    Gets Table described by name from the collection.

    • C#
    • VB.NET
    public Table this[string name] { get; }
    Public ReadOnly Property Item(name As String) As Table
    Parameters
    name
    System.String

    Name of the table.

    Property Value
    Table

    Methods

    Add(String, CellRange, Boolean)

    Adds a new Table to the collection.

    • C#
    • VB.NET
    public Table Add(string name, CellRange range, bool hasHeaders)
    Public Function Add(name As String, range As CellRange, hasHeaders As Boolean) As Table
    Parameters
    name
    System.String

    The name of the Table.

    range
    CellRange

    The Table cell range.

    hasHeaders
    System.Boolean

    Specifies whether the range contains a header row.

    Returns
    Table

    Newly added Table.

    Remarks

    Method creates and adds a new table to the worksheet. If hasHeaders is true first row in specified range will be used as header row; otherwise, table's range will be expanded by inserting a header row.

    Exceptions
    System.ArgumentNullException

    range is null.

    System.ArgumentException

    range doesn't belong to the parent worksheet.

    System.InvalidOperationException

    Table or DefinedName with same name already exists.

    Add(String, String, Boolean)

    Adds a new Table to the collection.

    • C#
    • VB.NET
    public Table Add(string name, string range, bool hasHeaders)
    Public Function Add(name As String, range As String, hasHeaders As Boolean) As Table
    Parameters
    name
    System.String

    The name of the Table.

    range
    System.String

    The Table cell range.

    hasHeaders
    System.Boolean

    Specifies whether the range contains a header row.

    Returns
    Table

    Newly added Table.

    Remarks

    Method creates and adds a new table to the worksheet. If hasHeaders is true first row in specified range will be used as header row; otherwise, table's range will be expanded by inserting a header row.

    GetEnumerator()

    Gets the collection enumerator.

    • C#
    • VB.NET
    public IEnumerator<Table> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of Table)
    Returns
    System.Collections.Generic.IEnumerator<Table>

    The collection enumerator.

    Remove(Table, RemoveShiftDirection)

    Removes the specified Table.

    • C#
    • VB.NET
    public bool Remove(Table table, RemoveShiftDirection direction)
    Public Function Remove(table As Table, direction As RemoveShiftDirection) As Boolean
    Parameters
    table
    Table

    The table.

    direction
    RemoveShiftDirection

    The removal shift direction.

    Returns
    System.Boolean

    True if Table was removed from the collection; otherwise, false.

    Exceptions
    System.ArgumentNullException

    table is null.

    RemoveAt(Int32, RemoveShiftDirection)

    Removes the Table at the specified index.

    • C#
    • VB.NET
    public void RemoveAt(int index, RemoveShiftDirection direction)
    Public Sub RemoveAt(index As Integer, direction As RemoveShiftDirection)
    Parameters
    index
    System.Int32

    The table index.

    direction
    RemoveShiftDirection

    The removal shift direction.

    Implements

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

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.