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

    Show / Hide Table of Contents

    ExcelCellCollection Class

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

    Collection of excel cells (ExcelCell).

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

    Properties

    Count

    Gets the number of currently allocated elements (dynamically changes when worksheet is modified -- read remarks).

    • C#
    • VB.NET
    public sealed override int Count { get; }
    Public NotOverridable Overrides ReadOnly Property Count As Integer
    Property Value
    System.Int32
    Overrides
    ExcelRowColumnCellCollectionBase.Count
    Remarks

    The cells are internally allocated in rows and not in columns. In other words, when you load CSV/XLS/XLSX or access some cells via worksheet.Cells property new rows and cells can be allocated but the column count will stay the same. To find last used column in the worksheet, use GemBox.Spreadsheet.ExcelWorksheet.GetUsedCellRange method.

    Item[Int32]

    Gets the cell with the specified index.

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

    The zero-based index of the cell.

    Property Value
    ExcelCell

    Methods

    GetEnumerator()

    Returns an enumerator that iterates through the collection.

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

    A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    See Also

    ExcelCell
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.