[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DBCtrls' (#lcl)

# TDBRadioGroup

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TDBRadioGroup is a data-aware version of TRadioGroup, providing a series of mutually exclusive buttons to select an entry to insert into a database field.

## Declaration

Source position: dbctrls.pp line 565

`type TDBRadioGroup = class(TCustomRadioGroup)`
`protected`
`procedure Change; virtual;` |  | Signals the OnChange event handler when assigned.
`procedure Notification(); override;` |  | Sets the DataSource to Nil when the control is destroyed.
`procedure DataChange();` |  | Updates the control display value when the linked dataset is repositioned.
`procedure UpdateData();` |  | Updates the linked dataset using the current selection in the control.
`property DataLink: TFieldDataLink; [r]` |  | Provides access to properties, methods, and events for the data-aware control.
`function GetButtonValue();` |  | Gets the value for the radio button at the specified position in the control.
`procedure UpdateRadioButtonStates; override;` |  | Updates the linked dataset to reflect the current radio button selected in the control.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destroy is the destructor for the class instance.
`procedure EditingDone; override;` |  | Performs actions needed when the user has finished editing.
`function ExecuteAction(); override;` |  | Implements support for standard actions in the control.
`function UpdateAction(); override;` |  | Updates the specified action to reflect the current state in the linked dataset.
`property Field: TField; [r]` |  | The DataSet Field relevant to the data being selected.
`property ItemIndex: Integer;` |  | Ordinal position for the selected radio button in the group.
`property Value: string; [rw]` |  | The value for the selected radio button in the control.
`published`
`property Align: TAlign;` |  | Specifies the placement of the control on its Parent control.
`property Anchors: TAnchors;` |  | The set of anchor definitions for this control.
`property AutoFill: Boolean;` |  | Indicates if radio buttons are resized to fill the available space in the control.
`property AutoSize: Boolean;` |  | Allows automatic adjustment of the size for the control, according to its content.
`property BiDiMode: TBiDiMode;` |  | Indicates whether text controls use in bi-directional reading.
`property BorderSpacing: TControlBorderSpacing;` |  | Determines the inner and outer border spacing for this control.
`property Caption: TCaption;` |  | Text displayed as the caption for the control.
`property ChildSizing: TControlChildSizing;` |  | Provides a grid (table) layout for the children of this control.
`property Color: TColor;` |  | The background color for the control.
`property ColumnLayout: TColumnLayout;` |  | Fill direction for columns on the grouped control.
`property Columns: Integer;` |  | Number of columns displayed for the radio buttons on the control.
`property Constraints: TSizeConstraints;` |  | Contains the minimum and maximum Width and Height for the control.
`property DataField: string; [rw]` |  | Name of the Field in the linked dataset where the control Value is stored.
`property DataSource: TDataSource; [rw]` |  | Provides access to the linked dataset and the field definition used in the control.
`property DoubleBuffered: Boolean;` |  | When enabled, it reduces flicker when the control is painted.
`property DragCursor: TCursor;` |  | The cursor shape shown during a drag operation.
`property DragMode: TDragMode;` |  | Determines how a drag operation is started for the control.
`property Enabled: Boolean;` |  | Determines whether the control responds to mouse or keyboard input.
`property Font: TFont;` |  | The font to be used for text display in this control.
`property Items: TStrings; [w]` |  | Contains the string values used as captions for radio buttons in the grouped data-aware control.
`property ParentBiDiMode: Boolean;` |  | Indicates whether the BiDiMode settings in the Parent control are used.
`property ParentColor: Boolean;` |  | Use the Color from the Parent control, when enabled.
`property ParentDoubleBuffered: Boolean;` |  | Value for the DoubleBuffered property in a Parent control.
`property ParentFont: Boolean;` |  | Indicates if the Font from the Parent control is used in the control.
`property ParentShowHint: Boolean;` |  | If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.
`property PopupMenu: TPopupMenu;` |  | A context-sensitive menu that pops up when the right mouse button is clicked over this control.
`property ReadOnly: Boolean; [rw]` |  | ReadOnly - if True, data can only be read, not written or modified. (Doesn't really make sense for a RadioGroup!).
`property ShowHint: Boolean;` |  | Enables Hint display for the control.
`property TabOrder: TTabOrder;` |  | Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.
`property TabStop: Boolean;` |  | Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.
`property Values: TStrings; [rw]` |  | The values of the strings in Items.
`property Visible: Boolean;` |  | Indicates if the control is visible on its parent.
`property OnChange: TNotifyEvent; [rw]` |  | Event Handler signalled when the Value for the control is changed.
`property OnChangeBounds: TNotifyEvent;` |  | Event handler signalled when the Bounds for the control have been changed.
`property OnClick: TNotifyEvent;` |  | Notification handler for mouse clicks.
`property OnContextPopup: TContextPopupEvent;` |  | Invoked when a context-sensitive pop-up menu is requested.
`property OnDragDrop: TDragDropEvent;` |  | Event handler signalled when an object is dropped onto the control.
`property OnDragOver: TDragOverEvent;` |  | Event handler signalled when a control is dragged over the control instance.
`property OnEndDrag: TEndDragEvent;` |  | Event handler signalled for the end of a drag-drop operation.
`property OnMouseDown: TMouseEvent;` |  | Event handler signalled when a mouse down event is handled for the control.
`property OnMouseEnter: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has entered the control.
`property OnMouseLeave: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has left the control.
`property OnMouseMove: TMouseMoveEvent;` |  | Event handler signalled when the mouse pointer is moved in the control.
`property OnMouseUp: TMouseEvent;` |  | Event handler signalled when a mouse up event is handled for the control.
`property OnMouseWheel: TMouseWheelEvent;` |  | Event handler for mouse wheel turned.
`property OnMouseWheelDown: TMouseWheelUpDownEvent;` |  | Event handler signalled for a downward movement of the mouse wheel.
`property OnMouseWheelUp: TMouseWheelUpDownEvent;` |  | Event handler signalled for an upward movement of the mouse wheel.
`property OnResize: TNotifyEvent;` |  | Notification handler for a resize of the control.
`property OnStartDrag: TStartDragEvent;` |  | Event handler signalled for the start of a dragging operation.
`end;`

## Inheritance

`TDBRadioGroup` |  | TDBRadioGroup is a data-aware version of TRadioGroup, providing a series of mutually exclusive buttons to select an entry to insert into a database field.
`TCustomRadioGroup` |  | TCustomRadioGroup is the base type for TRadioGroup.
`TCustomGroupBox` |  | The base class for TGroupBox, TRadioGroup and TCheckGroup.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

The properties of TDBRadioGroup are similar to those of TRadioGroup (and TCustomRadioGroup). Access is obtained to members of the group by selecting (in the Object Inspector) the ellipsis (...) next to the entry Items, and then editing the stringlist.

At run-time, selecting one of the radio buttons makes the corresponding ItemIndex available to the programmer, and the corresponding string Item gets selected and appears as the string value for the record in that field.

## See also

How To Use Data-aware Controls |  | HowToUseDataAwareControls - Hints for accessing databases.