TcxDBComboBox Class
A data-aware combo box.
#Declaration
TcxDBComboBox = class(
TcxCustomComboBox
)
#Remarks
A data-aware combo box allows you to display and edit values stored in a database. A combo box editor combines a single-line text editor and a drop-down menu. The drop-down menu displays a list of text strings accessible through the Properties.Items property. If user input in the text edit box matches initial characters in a menu string, the combo box allows a user to autocomplete the current input with the full string.
#End-User Input Options
Up and Down arrow keys allow users to switch between combo box items, even when the drop-down menu is closed. Ctrl+PageUp and Ctrl+PageDown keystrokes select first and last items, respectively.
#Drop-Down Menu Interaction
Users can do the following to open or close the drop-down combo box menu:
- Click the drop-down button.
- Focus the combo box and press the Alt+Up Arrow or Alt+Down Arrow key combination.
- Focus the combo box and press the F4 key.
Note
You can invoke the drop-down menu only if it contains at least one value.
#Main API Members
The list below outlines key members of the TcxComboBox
class that allow you to configure combo boxes and manage combo box items.
#Appearance and Behavior Settings
- BeepOnEnter
- Specifies if the combo box plays the default system sound when a user confirms input.
- Style | StyleDisabled | StyleFocused | StyleHot | StyleReadOnly
Allow you to define individual appearance settings for different editor states.
Tip
To apply the same style settings to multiple editors, use a Tcx
Edit component. If you need to apply the same style settings to all editors in your application, you can use a TcxStyle Controller Default component.Edit Style Controller - Styles
- Provides access to individual styles applied to the combo box in different states.
#Content-Related APIs
- Clear | EditingValue | EditValue | EditingText | EditText | ResetEditValue
- Manage the edit value.
- CopyToClipboard | CutToClipboard | PasteFromClipboard
- Allow you to perform clipboard operations.
- CanDropDown | DroppedDown | CloseUp
- Manage the drop-down menu.
- ItemIndex
- Specifies the active combo box item.
- OnEditing
- Allows you to prevent users from activating the combo box.
- PopupWindow
- Allows you to access and customize the drop-down menu.
- ResetEditValue
- Restores the previous edit value before the pending change is applied.
- SelectAll
- Selects editor content.
- SelStart | SelLength | SelText | SetSelection | SelectAll | ClearSelection
- Manage content selection.
- TextHint
- Specifies a text hint for the combo box when it has no assigned edit value.
- Undo
- Discards the last content change when the combo box has focus.
- ValidateEdit
- Validates the display value.
#Data-Related APIs
- CanPostEditValue
- Identifies if the data-aware combo box can post its edit value to the bound data storage.
- DataBinding
- Allows you to bind the combo box to data.
- OnPostEditValue
- Executes custom code when the editor posts its value to the bound data storage.
- PostEditValue
- Posts the edit value to the bound data storage.
#Combo Box Settings and Repository Items
- ActiveProperties
- Provides access to the current combo box settings regardless of their source. This property set does not allow you to customize combo box settings.
- GetPropertiesClass
- Returns the actual editor settings type.
- Properties
- Allows you to customize combo box settings directly if the combo box does not have an assigned repository item.
- RepositoryItem
- Specifies a repository item as an external source of combo box settings. A repository item has priority over other combo box settings.
#General-Purpose API Members
- Enabled
- Specifies if the combo box is enabled.
- CanModify
- Identifies if the combo box is in read-only mode.
- IsEditValidating | IsHiding | IsPosting
- Allow you to identify the current operation in the combo box.
- Width | Height
- Allow you to explicitly define combo box dimensions.
#Repository Item Class
You can create a TcxEditRepositoryComboBoxItem component in an edit repository to store combo box settings and share them between multiple combo boxes.
#Limitations
The data-aware combo box is designed as a standalone editor. You cannot use a TcxDBComboBox
class instance as an in-place editor in container controls.