Class

|                |
|----------------|
| DBKit.CheckBox |

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox

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

# Description

Displays and edits the value of a single database column for the current row as a checkbox.

The box is checked when the column value is true and unchecked when it is false. Changing the checkbox writes 1 (checked) or 0 (unchecked) back to the row automatically.

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

# Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                      | Type                               | Read-Only | Shared |
|-----------------------------------------------------------|------------------------------------|-----------|--------|
| `ColumnName<dbkit.checkbox.columnname>`                   | `String</api/data_types/string>`   |           |        |
| `DisplayName<dbkit.checkbox.displayname>`                 | `String</api/data_types/string>`   |           |        |
| `InvalidValueMessage<dbkit.checkbox.invalidvaluemessage>` | `String</api/data_types/string>`   |           |        |
| `Mandatory<dbkit.checkbox.mandatory>`                     | `Boolean</api/data_types/boolean>` |           |        |

# Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                  | Parameters | Returns                          | Shared |
|---------------------------------------|------------|----------------------------------|--------|
| `TableName<dbkit.checkbox.tablename>` |            | `String</api/data_types/string>` |        |

# Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                            | Parameters                                   | Returns |
|-------------------------------------------------|----------------------------------------------|---------|
| `RowChanged<dbkit.checkbox.rowchanged>`         | row As `DBKit.Row</api/databases/dbkit/row>` |         |
| `RowCreated<dbkit.checkbox.rowcreated>`         | row As `DBKit.Row</api/databases/dbkit/row>` |         |
| `RowDeleted<dbkit.checkbox.rowdeleted>`         | row As `DBKit.Row</api/databases/dbkit/row>` |         |
| `RowEditing<dbkit.checkbox.rowediting>`         | row As `DBKit.Row</api/databases/dbkit/row>` |         |
| `RowLoaded<dbkit.checkbox.rowloaded>`           | row As `DBKit.Row</api/databases/dbkit/row>` |         |
| `RowNotSelected<dbkit.checkbox.rownotselected>` |                                              |         |
| `RowSaved<dbkit.checkbox.rowsaved>`             | row As `DBKit.Row</api/databases/dbkit/row>` |         |
| `RowSaving<dbkit.checkbox.rowsaving>`           | row As `DBKit.Row</api/databases/dbkit/row>` |         |
| `RowUndone<dbkit.checkbox.rowundone>`           | row As `DBKit.Row</api/databases/dbkit/row>` |         |

# Property descriptions

<div id="dbkit.checkbox.columnname">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.ColumnName

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

> The name of the database column whose value this control displays and edits.
>
> If blank, the control's name is used as the column name. The name may be qualified with a table name (for example "tablename.columnname") when the control shows a column from a related table.
>
> <div class="tip">
>
> <div class="title">
>
> Tip
>
> </div>
>
> Instead of setting this property, you can name the control the same as the database column. DBKit first looks at the ColumnName property; if it is blank, it then uses the name of the control itself.
>
> </div>

<div id="dbkit.checkbox.displayname">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.DisplayName

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

> A user-friendly name for the control, shown to the user in place of the column name (for example in the `InvalidValueMessage<dbkit.checkbox.invalidvaluemessage>`).
>
> If blank, the column name is de-camelcased automatically (for example "FirstName" becomes "First Name").

<div id="dbkit.checkbox.invalidvaluemessage">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.InvalidValueMessage

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

> The message displayed when the field is mandatory but is not checked. Use \<\$1\> as a placeholder for the control's display name.
>
> The default is "\<\$1\> must be checked."

<div id="dbkit.checkbox.mandatory">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.Mandatory

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

> If `True</api/language/true>`, the checkbox must be checked before the row can be saved. When a row with an unchecked mandatory checkbox is saved, the `InvalidValueMessage<dbkit.checkbox.invalidvaluemessage>` is displayed and the save is cancelled.
>
> The default is `False</api/language/false>`.

# Method descriptions

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.TableName

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

> Returns the name of the database table the control's column belongs to, resolved from the control's layout.

# Event descriptions

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.RowChanged

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.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.checkbox.rowdeleted">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.RowDeleted

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.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.checkbox.rowloaded">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.RowLoaded

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.RowNotSelected

**RowNotSelected**

> There is no row currently selected.

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.RowSaved

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.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.checkbox.rowundone">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.CheckBox.RowUndone

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

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

# Notes

## Localization

Localize the control's user-facing text (`InvalidValueMessage<dbkit.checkbox.invalidvaluemessage>`) 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.checkbox.seealso">

<div class="seealso">

`DesktopCheckBox</api/user_interface/desktop/desktopcheckbox>` (desktop) and `WebCheckBox</api/user_interface/web/webcheckbox>` (web) parent classes; `DBKit.Row</api/databases/dbkit/row>` class.

</div>

</div>
