From Xojo Documentation

Revision as of 19:53, 13 February 2022 by Gperlman (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

iOSMobileTable.AddSection(title As String = "")

Supported on Mobile.

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


iOSMobileTable.AddSection(title As String = "") As Integer

Supported on Mobile.

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


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.

If a DataSource is assigned, sections cannot be added because the DataSource is responsible for that. If you try to add a section when a DataSource has been assigned, an UnsupportedOperationException will be raised.

Sample Code

Add a section called "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")