iOSTable.InsertRow

From Xojo Documentation

Method

iOSTable.InsertRow(section As Integer, index As Integer)

Supported on Mobile (iOS).

Inserts a single row into the table without forcing a full table refresh from the DataSource.

Parameters

Value Description
section The section is added before this index section.
index The row is added before this index row.

Exceptions

Exception Description
OutOfBoundsException When the section or index does not exist.
UnsupportedOperationException When the table does not have a DataSource specified.

Notes

When you insert the row using this version of the method, its value is fetched from the DataSource. This method only works when the table has a DataSource specified.


Method

iOSTable.InsertRow(section As Integer, index As Integer, cell As iOSTableCellData)

Supported on Mobile (iOS).

Inserts cell data for the section at the row index.

Parameters

Value Description
section The section is added before this index section.
index The row is added before this index row.
cell The iOSTableCellData to use for the row that is inserted.

Exceptions

Exception Description
OutOfBoundsException When the section or index does not exist.


Method

iOSTable.InsertRow(section As Integer, index As Integer, rowText As Text)

Supported on Mobile (iOS).

Inserts the rowText for the section at the row index.

Parameters

Value Description
section The section is added before this index section.
index The row is added before this index row.
rowText The text to use for the row that is inserted.

Exceptions

Exception Description
OutOfBoundsException When the section or index does not exist.

Sample Code

Inserts a row at the beginning of the table, retrieving its value from the specified DataSource:

Table1.InsertRow(0, 0)

Inserts a row in the first section:

Var cell As New iOSTableCellData
cell.Text = "Hello"
Table1.InsertRow(0, 0, cell)

Inserts a row in the first position of the Table:

Table1.InsertRow(0, 0, "First Row")