TableCollection Class
A collection of Table items. Supported in XLSX only.
- Inheritance:
- System.
Object TableCollection
Properties
Count
Gets the number of Tables contained in the collection.
Property Value
- System.
Int32
The number of Tables contained in the collection.
Item[Int32]
Gets the Table at the specified index.
Parameters
index
- System.
Int32
The zero-based index of the Table.
Property Value
Item[String]
Gets Table described by name from the collection.
Parameters
name
- System.
String
Name of the table.
Property Value
Methods
Add(String, CellRange, Boolean)
Adds a new Table to the collection.
Parameters
name
- System.
String
The name of the Table.
hasHeaders
- System.
Boolean
Specifies whether the range contains a header row.
Returns
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.
Argument Null Exception
range
is null.
- System.
Argument Exception
range
doesn't belong to the parent worksheet.
- System.
Invalid Operation Exception
Table or Defined
Add(String, String, Boolean)
Adds a new Table to the collection.
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
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.
Returns
- System.
Collections. <Table>Generic. IEnumerator
The collection enumerator.
Remove(Table, RemoveShiftDirection)
Removes the specified Table.
Parameters
table
- Table
The table.
direction
- Remove
Shift Direction
The removal shift direction.
Returns
- System.
Boolean
True
if Table was removed from the collection; otherwise, false
.
Exceptions
- System.
Argument Null Exception
table
is null.
RemoveAt(Int32, RemoveShiftDirection)
Removes the Table at the specified index.
Parameters
index
- System.
Int32
The table index.
direction
- Remove
Shift Direction
The removal shift direction.