Class

# DBKit.Table

<div class="rst-class">

forsearch

</div>

DBKit.Table

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Displays rows of records from the database table assigned to it.

Only the members declared by <span class="title-ref">DBKit.Table</span> itself are described here; for the inherited members, see `the parent classes<dbkit.table.seealso>`.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                             | Type                               | Read-Only | Shared |
|------------------------------------------------------------------|------------------------------------|-----------|--------|
| `AllowDirectCellEditing<dbkit.table.allowdirectcellediting>`     | `Boolean</api/data_types/boolean>` |           |        |
| `ColumnFormats<dbkit.table.columnformats>`                       | `String</api/data_types/string>`   |           |        |
| `ColumnNames<dbkit.table.columnnames>`                           | `String</api/data_types/string>`   |           |        |
| `EditableColumnNames<dbkit.table.editablecolumnnames>`           | `String</api/data_types/string>`   |           |        |
| `NoRelatedRowFoundMessage<dbkit.table.norelatedrowfoundmessage>` | `String</api/data_types/string>`   |           |        |
| `OrderBy<dbkit.table.orderby>`                                   | `String</api/data_types/string>`   |           |        |
| `TableName<dbkit.table.tablename>`                               | `String</api/data_types/string>`   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                      | Parameters                                                                                                                                       | Returns                            | Shared |
|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|--------|
| `Average<dbkit.table.average>`            | columnName As `String</api/data_types/string>`                                                                                                   | `Double</api/data_types/double>`   |        |
| `CellValueAt<dbkit.table.cellvalueat>`    | row As `Integer</api/data_types/integer>`, column As `Integer</api/data_types/integer>`, formatted As `Boolean</api/data_types/boolean>` = False | `Variant</api/data_types/variant>` |        |
| `HeaderAt<dbkit.table.headerat>`          | index As `Integer</api/data_types/integer>`                                                                                                      | `String</api/data_types/string>`   |        |
| `Maximum<dbkit.table.maximum>`            | columnName As `String</api/data_types/string>`                                                                                                   | `Double</api/data_types/double>`   |        |
| `Minimum<dbkit.table.minimum>`            | columnName As `String</api/data_types/string>`                                                                                                   | `Double</api/data_types/double>`   |        |
| `NewRow<dbkit.table.newrow>`              |                                                                                                                                                  |                                    |        |
| `PrimaryKeyAt<dbkit.table.primarykeyat>`  | index As `Integer</api/data_types/integer>`                                                                                                      | `String</api/data_types/string>`   |        |
| `Refresh<dbkit.table.refresh>`            | whereClause As `String</api/data_types/string>` = "", searchValues() As `Variant</api/data_types/variant>` = Nil                                 |                                    |        |
| `RowCount<dbkit.table.rowcount>`          |                                                                                                                                                  | `Integer</api/data_types/integer>` |        |
| `Sum<dbkit.table.sum>`                    | columnName As `String</api/data_types/string>`                                                                                                   | `Double</api/data_types/double>`   |        |
| `TableName<dbkit.table.tablename-method>` |                                                                                                                                                  | `String</api/data_types/string>`   |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                             | Parameters                                   | Returns                                     |
|--------------------------------------------------|----------------------------------------------|---------------------------------------------|
| `DoublePressed<dbkit.table.doublepressed>`       |                                              | `DBKit.Window</api/databases/dbkit/window>` |
| `RowChanged<dbkit.table.rowchanged>`             | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowCreated<dbkit.table.rowcreated>`             | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowDeleted<dbkit.table.rowdeleted>`             | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowDisplayed<dbkit.table.rowdisplayed>`         | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowEditing<dbkit.table.rowediting>`             | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowLoaded<dbkit.table.rowloaded>`               | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowNotSelected<dbkit.table.rownotselected>`     |                                              |                                             |
| `RowSaved<dbkit.table.rowsaved>`                 | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowSaving<dbkit.table.rowsaving>`               | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `RowUndone<dbkit.table.rowundone>`               | row As `DBKit.Row</api/databases/dbkit/row>` |                                             |
| `SelectionChanged<dbkit.table.selectionchanged>` |                                              |                                             |

## Property descriptions

<div id="dbkit.table.allowdirectcellediting">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.AllowDirectCellEditing

**AllowDirectCellEditing** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the user can edit the values of cells directly in the Table.
>
> The default is `False</api/language/false>`.

<div id="dbkit.table.columnformats">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.ColumnFormats

**ColumnFormats** As `String</api/data_types/string>`

> A comma-separated list of format strings, one for each column of the Table, used when formatting numeric values.

<div id="dbkit.table.columnnames">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.ColumnNames

**ColumnNames** As `String</api/data_types/string>`

> A comma-separated list of the database column names displayed by the Table, one for each column of the Table.
>
> The number of column names must match the number of columns in the Table.
>
> To display a column from a related table, qualify it with the table name, for example `products.name`. When the tables are related in more than one way, follow the column with a colon and the foreign key column in tableName.columnName form to specify which relationship to use.

<div id="dbkit.table.editablecolumnnames">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.EditableColumnNames

**EditableColumnNames** As `String</api/data_types/string>`

> A comma-separated list of the database column names whose values the user can edit.

<div id="dbkit.table.norelatedrowfoundmessage">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.NoRelatedRowFoundMessage

**NoRelatedRowFoundMessage** As `String</api/data_types/string>`

> The message displayed when no related row is found.
>
> The default is "No row found with that value."

<div id="dbkit.table.orderby">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.OrderBy

**OrderBy** As `String</api/data_types/string>`

> Specifies the order in which the rows are displayed, as a SQL ORDER BY clause (without the words ORDER BY).

<div id="dbkit.table.tablename">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.TableName

**TableName** As `String</api/data_types/string>`

> The name of the database table whose rows this control displays.

## Method descriptions

<div id="dbkit.table.average">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.Average

**Average**(columnName As `String</api/data_types/string>`) As `Double</api/data_types/double>`

> Returns the average of the values in the column with the given name, over the rows found. An unsaved new row is not included.

<div id="dbkit.table.cellvalueat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.CellValueAt

**CellValueAt**(row As `Integer</api/data_types/integer>`, column As `Integer</api/data_types/integer>`, formatted As `Boolean</api/data_types/boolean>` = False) As `Variant</api/data_types/variant>`

> The value of a cell. By default the underlying, unformatted value with its own type (a Double for a price, for example). With *formatted* = `True</api/language/true>`, the text as the user sees it. Works for any row, whether or not it has been displayed yet.

<div id="dbkit.table.headerat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.HeaderAt

**HeaderAt**(index As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Returns the header of the column at the given index.
>
> (Desktop only.)

<div id="dbkit.table.maximum">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.Maximum

**Maximum**(columnName As `String</api/data_types/string>`) As `Double</api/data_types/double>`

> Returns the largest value in the column with the given name, over the rows found. Raises an exception if there are no rows.

<div id="dbkit.table.minimum">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.Minimum

**Minimum**(columnName As `String</api/data_types/string>`) As `Double</api/data_types/double>`

> Returns the smallest value in the column with the given name, over the rows found. Raises an exception if there are no rows.

<div id="dbkit.table.newrow">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.NewRow

**NewRow**()

> Creates a new row.

<div id="dbkit.table.primarykeyat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.PrimaryKeyAt

**PrimaryKeyAt**(index As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Returns the primary key of the row at the given index.

<div id="dbkit.table.refresh">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.Refresh

**Refresh**(whereClause As `String</api/data_types/string>` = "", searchValues() As `Variant</api/data_types/variant>` = Nil)

> Reloads the Table's rows from the database, applying the given WHERE clause (without the word WHERE) and search values.

<div id="dbkit.table.rowcount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowCount

**RowCount**() As `Integer</api/data_types/integer>`

> Returns the number of rows in the Table.

<div id="dbkit.table.sum">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.Sum

**Sum**(columnName As `String</api/data_types/string>`) As `Double</api/data_types/double>`

> Returns the sum of the values in the column with the given name.

<div id="dbkit.table.tablename-method">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.TableName

**TableName**() As `String</api/data_types/string>`

> Returns the name of the database table for this control: the `TableName<dbkit.table.tablename>` property if set, otherwise the table name of the control's layout.

## Event descriptions

<div id="dbkit.table.doublepressed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.DoublePressed

**DoublePressed**() As `DBKit.Window</api/databases/dbkit/window>`

> The user double-pressed a row.
>
> Implement this event to return the layout to display for the row: the `DBKit.Window</api/databases/dbkit/window>` in desktop projects or the `DBKit.Page</api/databases/dbkit/page>` in web projects.

<div id="dbkit.table.rowchanged">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowChanged

**RowChanged**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The current row (passed to the event) has been changed.

<div id="dbkit.table.rowcreated">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowCreated

**RowCreated**(row As `DBKit.Row</api/databases/dbkit/row>`)

> A new row (passed to the event) was just created and is now the current row.

<div id="dbkit.table.rowdeleted">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowDeleted

**RowDeleted**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The current row (passed to the event) has been deleted.

<div id="dbkit.table.rowdisplayed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowDisplayed

**RowDisplayed**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The current row (passed to the event) is being displayed.
>
> Implement this event to set calculated column values, since `RowChanged<dbkit.table.rowchanged>` does not fire while rows are being displayed.

<div id="dbkit.table.rowediting">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowEditing

**RowEditing**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The current row (passed to the event) is being edited by the user.

<div id="dbkit.table.rowloaded">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowLoaded

**RowLoaded**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The current row (passed to the event) has been loaded.

<div id="dbkit.table.rownotselected">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowNotSelected

**RowNotSelected**

> There is no row currently selected.

<div id="dbkit.table.rowsaved">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowSaved

**RowSaved**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The current row (passed to the event) has been saved.

<div id="dbkit.table.rowsaving">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowSaving

**RowSaving**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The current row (passed to this event) is about to be saved.

<div id="dbkit.table.rowundone">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.RowUndone

**RowUndone**(row As `DBKit.Row</api/databases/dbkit/row>`)

> The changes made to the current row (passed to this event) have been undone.

<div id="dbkit.table.selectionchanged">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

DBKit.Table.SelectionChanged

**SelectionChanged**()

> The selected row changed.

## Notes

### Loading its own rows

The Table loads its rows in its own Opening event, so no layout code is needed to display rows. Rows are loaded from the database on demand as the user scrolls.

### Which rows are displayed

The Table displays all rows of its table by default. If the layout's Where property (`Window<dbkit.window.where>`, `Page<dbkit.page.where>`, `Container<dbkit.container.where>`) provides a WHERE clause, only the matching rows are displayed. When the user searches with a `DBKit.SearchField</api/databases/dbkit/searchfield>`, the Table displays the search results instead.

### Editing cells with the keyboard

When `AllowDirectCellEditing<dbkit.table.allowdirectcellediting>` is True, pressing Tab moves to the next editable cell and Shift-Tab moves to the previous editable cell.

### Decimal places come from the column format

For numeric columns, the number of decimal places the user may enter is determined by the column's format in `ColumnFormats<dbkit.table.columnformats>`.

### Displaying a detail layout

Implement `DoublePressed<dbkit.table.doublepressed>` to return a new instance of the detail layout for the double-pressed row. Pass the Table to the new layout's constructor so the layout is bound to it.

### One Table per layout table

A layout can contain only one Table whose `TableName<dbkit.table.tablename>` matches the layout's `TableName<dbkit.table.tablename>`. Adding a second one raises an exception. To display more than one list of rows from the same table, place the additional Tables on `DBKit.Containers</api/databases/dbkit/container>`.

### Calculated columns

Use the `RowDisplayed<dbkit.table.rowdisplayed>` event to compute a column value from other columns, setting the value on the row passed to the event, for example `row.Column("linetotal") = row.Column("quantity").IntegerValue * row.Column("price").DoubleValue`. `RowChanged<dbkit.table.rowchanged>` does not fire while rows are being displayed, so implement `RowDisplayed<dbkit.table.rowdisplayed>` to keep calculated values up to date. `RowDeleted<dbkit.table.rowdeleted>` fires when a row is deleted, so implement it to keep any totals current.

### Saving a row updates the Table

When a row is saved, DBKit updates the Table columns that display the row's values, adding the row to the Table and selecting it if it is new. This happens whether the row was edited on the same layout as the Table or on a separate detail layout.

### Localization

Localize the control's user-facing text (`NoRelatedRowFoundMessage<dbkit.table.norelatedrowfoundmessage>`) the standard Xojo way: assign a dynamic constant to each property and provide translations for as many languages as you need, or localize the property values directly.

## Compatibility

|                       |              |
|-----------------------|--------------|
| **Project Types**     | Desktop, Web |
| **Operating Systems** | All          |

<div id="dbkit.table.seealso">

<div class="seealso">

`DesktopTable</api/user_interface/desktop/desktoptable>` (desktop) and `WebListBox</api/user_interface/web/weblistbox>` (web) parent classes; `DBKit.Row</api/databases/dbkit/row>` class.

</div>

</div>
