Show / Hide Table of Contents

Class WorksheetRowCollection

A collection of rows in a worksheet.

Inheritance
System.Object
WorksheetItemCollection<WorksheetRow>
RowColumnCollectionBase<WorksheetRow>
WorksheetRowCollection
Implements
System.Collections.Generic.ICollection<WorksheetRow>
System.Collections.Generic.IEnumerable<WorksheetRow>
System.Collections.IEnumerable
Namespace: Infragistics.Documents.Excel
Assembly: IgniteUI.Blazor.Documents.Excel.dll
Syntax
public class WorksheetRowCollection : RowColumnCollectionBase<WorksheetRow>, ICollection<WorksheetRow>, IEnumerable<WorksheetRow>, IEnumerable, ILoadOnDemandTreeOwner<WorksheetRow>
Remarks

Rows in this collection are lazily created (they are only created and added to the collection when they are accessed). If this collection is enumerated, it only enumerates the rows which were already accessed.

Properties

Item[Int32]

Gets the row at the specified index.

Declaration
public WorksheetRow this[int index] { get; }
Parameters
Type Name Description
System.Int32 index

The zero-based index of the row to get.

Property Value
Type Description
WorksheetRow

The row at the specified index.

Remarks

Note: Iterating the collection will not create all rows. It will only iterate the rows which have already been used. To create and iterate all rows in the worksheet use a For loop, iterating from 0 to one less than the maximum row count, and pass in each index to the collection's indexer.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

index is less than zero.

System.InvalidOperationException

index is greater than or equal to MaxExcelRowCount or MaxExcel2007RowCount, depending on the CurrentFormat.

MaxCount

Gets the maximum number of items allowed in this collection.

Declaration
protected override int MaxCount { get; }
Property Value
Type Description
System.Int32
Overrides
Infragistics.Documents.Excel.WorksheetItemCollection<Infragistics.Documents.Excel.WorksheetRow>.MaxCount

Methods

Insert(Int32, Int32)

Inserts one or more rows into the collection

Declaration
public void Insert(int index, int count = 1)
Parameters
Type Name Description
System.Int32 index

the insertion point

System.Int32 count

The number of rows to insert

Remarks

Note: An equal number of rows will be removed (i.e. bumped) off the end of the collection.

Exceptions
Type Condition
System.InvalidOperationException

If the operation is not allowed, e.g. if it would cause data to be shifted off the worksheet.

System.IndexOutOfRangeException

If index is negative.

System.ArgumentOutOfRangeException

If count is less than 1.

Remove(Int32, Int32)

Removes one or more rows from the collection

Declaration
public void Remove(int index, int count = 1)
Parameters
Type Name Description
System.Int32 index

the index of the first row to remove point

System.Int32 count

The number of rows to remove

Exceptions
Type Condition
System.InvalidOperationException

If the operation is not allowed, e.g. if it the range intersects with a protected region.

System.IndexOutOfRangeException

If index is negative.

System.ArgumentOutOfRangeException

If count is less than 1.

Implements

System.Collections.Generic.ICollection<>
System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable

See Also

WorksheetRow
Rows
In This Article
  • Properties
    • Item[Int32]
    • MaxCount
  • Methods
    • Insert(Int32, Int32)
    • Remove(Int32, Int32)
  • Implements
  • See Also