iOSTable.AddSection

From Xojo Documentation

Method

Adds a section, with the optional title, to the table.


Method

iOSTable.AddSection(title As Text = "") As Integer

Supported on Mobile (iOS).

Adds a section, with the optional title, to the table returning the index number for the new section.

Parameters

Parameter Description
title The optional title to name the newly added section.

Notes

For a Plain table format, section headings appear in the table itself. Only non-blank section titles appear. If you add a section with a blank title, you cannot change the title later.

For a Group table format, the sections appear outside of the table.

Exceptions

Exception Description
UnsupportedOperationException When the table has a DataSource specified.

Sample Code

Add a section called "Tasks":

Table1.AddSection("Tasks")

You may want to add a section and save the returned section number so you can use it to subsequently add rows:

Var newSection As Integer = Table1.AddSection("Tasks")
Table1.AddRow(newSection, "Task 1")
Table1.AddRow(newSection, "Task 2")