iOSMobileTable.AddSection

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. It will go offline as of October 2, 2023. Please visit the new Xojo documentation site! - you will be redirected shortly...
Method

iOSMobileTable.AddSection(title As String = "")

Supported on Mobile.

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


Method

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.

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.

fa-exclamation-circle-32.png
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":

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")