Class

# DBKit.RadioGroup

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup

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

## Description

Can display and edit the column value of the current row of the database table to which it has been assigned.

It displays the column value as a group of radio buttons.

The group can populate itself from a database table when the control opens. If `AutoPopulateTableName<dbkit.radiogroup.autopopulatetablename>` and `AutoPopulateColumnName<dbkit.radiogroup.autopopulatecolumnname>` are set, the group fills with a radio button for each value of that column, and the selected value (or its primary key, depending on `AutoPopulateStorageType<dbkit.radiogroup.autopopulatestoragetype>`) is stored in the row.

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

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                                | Type                                          | Read-Only | Shared |
|---------------------------------------------------------------------|-----------------------------------------------|-----------|--------|
| `AutoPopulateColumnName<dbkit.radiogroup.autopopulatecolumnname>`   | `String</api/data_types/string>`              |           |        |
| `AutoPopulateStorageType<dbkit.radiogroup.autopopulatestoragetype>` | `StorageTypes<dbkit.radiogroup.storagetypes>` |           |        |
| `AutoPopulateTableName<dbkit.radiogroup.autopopulatetablename>`     | `String</api/data_types/string>`              |           |        |
| `ColumnName<dbkit.radiogroup.columnname>`                           | `String</api/data_types/string>`              |           |        |
| `DefaultRowIndex<dbkit.radiogroup.defaultrowindex>`                 | `Integer</api/data_types/integer>`            |           |        |
| `DisplayName<dbkit.radiogroup.displayname>`                         | `String</api/data_types/string>`              |           |        |
| `InvalidValueMessage<dbkit.radiogroup.invalidvaluemessage>`         | `String</api/data_types/string>`              |           |        |
| `Mandatory<dbkit.radiogroup.mandatory>`                             | `Boolean</api/data_types/boolean>`            |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

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

## Events

<div class="rst-class">

table-centered_column_4

</div>

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

## Enumerations

<div id="dbkit.radiogroup.storagetypes">

<div class="rst-class">

forsearch

</div>

</div>

DBKit.RadioGroup.StorageTypes

### StorageTypes

> How the selected button value is stored in the database.
>
> | Types       |
> |-------------|
> | ColumnValue |
> | PrimaryKey  |
>
> ColumnValue stores the selected button's caption in the database column. PrimaryKey stores the primary key of the selected row, which is kept in the button's tag, in the database column.

## Property descriptions

<div id="dbkit.radiogroup.autopopulatecolumnname">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.AutoPopulateColumnName

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

> The name of the database column whose values fill the group when the control populates itself. If blank, `ColumnName<dbkit.radiogroup.columnname>` is used.

<div id="dbkit.radiogroup.autopopulatestoragetype">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.AutoPopulateStorageType

**AutoPopulateStorageType** As `StorageTypes<dbkit.radiogroup.storagetypes>`

> Whether the group stores the selected button's caption or its primary key in the database column.

<div id="dbkit.radiogroup.autopopulatetablename">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.AutoPopulateTableName

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

> The name of the database table the group populates itself from when the control opens. If blank, the control's table is used.

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.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 id="dbkit.radiogroup.defaultrowindex">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.DefaultRowIndex

**DefaultRowIndex** As `Integer</api/data_types/integer>`

> The index of the button that is selected when a new row is created.

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.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.radiogroup.invalidvaluemessage>`).

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.InvalidValueMessage

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

> The message displayed when the control is mandatory but has no selection. Use \<\$1\> as a placeholder for the control's display name.
>
> The default is "\<\$1\> must have a button selected."

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.Mandatory

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

> If `True</api/language/true>`, the user must select a button before the row can be saved. When a row with no selection in a mandatory control is saved, the `InvalidValueMessage<dbkit.radiogroup.invalidvaluemessage>` is displayed and the save is cancelled.

## Method descriptions

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.TableName

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

> Returns the name of the database table the control's column belongs to. If the `ColumnName<dbkit.radiogroup.columnname>` is qualified with a table name (for example "tablename.columnname"), that table name is returned; otherwise the table is resolved from the control's layout.

## Event descriptions

<div id="dbkit.radiogroup.error">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.Error

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

> A DatabaseException occurred when the control attempted to auto-populate itself from a database table.
>
> Implement this event to display your own error message instead of DBKit's default message. Return the message to display, or return an empty string to display no message at all. If you do not implement this event, DBKit displays a default error message.

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.RowChanged

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.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.radiogroup.rowdeleted">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.RowDeleted

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.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.radiogroup.rowloaded">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.RowLoaded

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.RowNotSelected

**RowNotSelected**

> There is no row currently selected.

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.RowSaved

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

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

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

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.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.radiogroup.rowundone">

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

</div>

<div class="rst-class">

forsearch

</div>

DBKit.RadioGroup.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.radiogroup.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 |
| **Operating Systems** | All     |

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

<div class="seealso">

`DesktopRadioGroup</api/user_interface/desktop/desktopradiogroup>` parent class; `DBKit.Row</api/databases/dbkit/row>` class.

</div>

</div>
