Class
DBKit.RadioGroup
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 and 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) is stored in the row.
Only the members declared by DBKit.RadioGroup itself are described here; for the inherited members, see the parent class.
Properties
Name |
Type |
Read-Only |
|---|---|---|
Methods
Name |
Parameters |
Returns |
|---|---|---|
Events
Name |
Parameters |
Returns |
|---|---|---|
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
Enumerations
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
DBKit.RadioGroup.AutoPopulateColumnName
AutoPopulateColumnName As String
The name of the database column whose values fill the group when the control populates itself. If blank, ColumnName is used.
DBKit.RadioGroup.AutoPopulateStorageType
AutoPopulateStorageType As StorageTypes
Whether the group stores the selected button's caption or its primary key in the database column.
DBKit.RadioGroup.AutoPopulateTableName
AutoPopulateTableName As String
The name of the database table the group populates itself from when the control opens. If blank, the control's table is used.
DBKit.RadioGroup.ColumnName
ColumnName As 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.
DBKit.RadioGroup.DefaultRowIndex
DefaultRowIndex As Integer
The index of the button that is selected when a new row is created.
DBKit.RadioGroup.DisplayName
DisplayName As 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
InvalidValueMessage As 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."
DBKit.RadioGroup.Mandatory
Mandatory As Boolean
If 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 is displayed and the save is cancelled.
Method descriptions
DBKit.RadioGroup.TableName
TableName() As String
Returns the name of the database table the control's column belongs to. If the 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
DBKit.RadioGroup.Error
Error() As 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.
DBKit.RadioGroup.RowChanged
RowChanged(row As DBKit.Row)
The current row (passed to the event) has been changed.
DBKit.RadioGroup.RowCreated
RowCreated(row As DBKit.Row)
A new row (passed to the event) was just created and is now the current row.
DBKit.RadioGroup.RowDeleted
RowDeleted(row As DBKit.Row)
The current row (passed to the event) has been deleted.
DBKit.RadioGroup.RowEditing
RowEditing(row As DBKit.Row)
The current row (passed to the event) is being edited by the user.
DBKit.RadioGroup.RowLoaded
RowLoaded(row As DBKit.Row)
The current row (passed to the event) has been loaded.
DBKit.RadioGroup.RowNotSelected
RowNotSelected
There is no row currently selected.
DBKit.RadioGroup.RowSaved
RowSaved(row As DBKit.Row)
The current row (passed to the event) has been saved.
DBKit.RadioGroup.RowSaving
RowSaving(row As DBKit.Row)
The current row (passed to this event) is about to be saved.
DBKit.RadioGroup.RowUndone
RowUndone(row As DBKit.Row)
The changes made to the current row (passed to this event) have been undone.
Notes
Localize the control's user-facing text (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 |
See also
DesktopRadioGroup parent class; DBKit.Row class.