Class SFTable
Implements a two-dimensional table that holds an SFArrayList of rows. Each row is an SFArrayList of objects.
Inheritance
Implements
Namespace: Syncfusion.XlsIO.Implementation.Collections
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class SFTable : Object, ICloneable
Remarks
This is a memory efficient way to represent a table where values can remain empty. Only rows that actually contain data will allocate an SFArrayList and the array only holds as many objects as the specific row contains columns.
When you access data that are out of range, an empty () object will be returned. If you set data that are out of range, an exception will be thrown. If you set data for a row that is empty, the row will be allocated before the value is stored.
SFTable provides methods that let you insert, remove or rearrange columns or m_arrRows in the table.
Constructors
SFTable(SFTable, Boolean)
Initializes a new instance of the SFTable class and optional copies of data from an existing table.
Declaration
protected SFTable(SFTable data, bool clone)
Parameters
Type | Name | Description |
---|---|---|
SFTable | data | Table to copy. |
System.Boolean | clone | Indicates whether to copy data. |
SFTable(SFTable, Boolean, Object)
Initializes a new instance of the SFTable class and optional copies of data from an existing table.
Declaration
protected SFTable(SFTable data, bool clone, object parent)
Parameters
Type | Name | Description |
---|---|---|
SFTable | data | Table to copy. |
System.Boolean | clone | Indicates whether to copy data. |
System.Object | parent | Parent object for the new items. |
SFTable(Int32, Int32)
Initializes a new instance of the SFTable class that is empty.
Declaration
public SFTable(int iRowCount, int iColumnCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowCount | Number of rows in the collection. |
System.Int32 | iColumnCount | Number of columns in the collection. |
Properties
CellCount
Returns number of cells in the collection. Read-only.
Declaration
public int CellCount { get; }
Property Value
Type |
---|
System.Int32 |
ColCount
Gets the number of columns contained in the SFTable. Read-only.
Declaration
public int ColCount { get; }
Property Value
Type |
---|
System.Int32 |
Item[Int32, Int32]
Gets / sets an element at the specified coordinates in the SFTable.
Declaration
public object this[int rowIndex, int colIndex] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The zero-based row index. |
System.Int32 | colIndex | The zero-based column index. |
Property Value
Type |
---|
System.Object |
Remarks
If you query for an element and the coordinates are out of range, an empty (null) object will be returned.
If you set an element and the the coordinates are out of range, an exception is thrown.
RowCount
Gets the number of rows contained in the SFTable. Read-only.
Declaration
public int RowCount { get; }
Property Value
Type |
---|
System.Int32 |
Rows
Returns the SFArrayList from all rows.
Declaration
public SFArrayList<object> Rows { get; }
Property Value
Type |
---|
SFArrayList<System.Object> |
Methods
Clear()
Removes all elements from the SFTable.
Declaration
public void Clear()
Clone()
Creates a deep copy of the SFTable.
Declaration
public virtual object Clone()
Returns
Type | Description |
---|---|
System.Object | A deep copy of the SFTable. |
Clone(Object)
Creates a deep copy of the SFTable.
Declaration
public virtual object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the items. |
Returns
Type | Description |
---|---|
System.Object | A deep copy of the SFTable. |
Contains(Int32, Int32)
Indicates whether an element is at the specified coordinates in the SFTable.
Declaration
public bool Contains(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The zero-based row index. |
System.Int32 | colIndex | The zero-based column index. |
Returns
Type | Description |
---|---|
System.Boolean | true if an element exists at the specified coordinates in the SFTable; false otherwise. |
CreateCellCollection()
Creates a collection of cells for a row.
Declaration
public virtual SFArrayList<object> CreateCellCollection()
Returns
Type | Description |
---|---|
SFArrayList<System.Object> | An SFArrayList or derived object for the cell collection. |