iOSMobileTable.AddSection

From Xojo Documentation

Revision as of 23:46, 24 January 2022 by Gperlman (talk | contribs) (Exceptions)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
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.

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.

The following exception can be raised:

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