Jens Mühlenhoff
Jens Mühlenhoff

Reputation: 14883

Is there a ComboBox that has Items like a TcxRadioGroup?

The TcxRadioGroup component of DevExpress has a very nice way to specify items. You can specify a Caption and a Value (and a Tag) for each TcxRadioGroupItem.

The TcxComboBox and the normal TComboBox of Delphi on the other hand use TStrings to store its items.

While TStrings can have a Name and an Object, there is no easy way to hook up a name and a value using the form designer of the Delphi IDE.

Is there a ComboBox control (preferably from DevExpress) that allows to visually design its items with a Caption and a Value?

PS: I'm not looking for a DB aware control.

Upvotes: 0

Views: 1110

Answers (4)

Mikael
Mikael

Reputation: 1

Use a standard Delphi TComboBox, it can store a string (for visualization, and an object of any TObject descendant that you implement yourself, i.e you can store anything associated to a string in the dropdown).

Upvotes: 0

Max Williams
Max Williams

Reputation: 821

ESBPCS for VCL has an enhanced Lookup ComboBox. It stores 2 Lists, the ones normally in TCombobox's Items as well as the new Values list. These two StringLists are in a 1-1 relationship. Use AsItem to retrieve the string currently displayed and AsValue to retrieve the "related" string from Values.

Upvotes: 1

Uli Gerhardt
Uli Gerhardt

Reputation: 14001

Try a TcxImageComboBox. See here - you don't have to assign images despite the name. You can also edit the items visually.

(I use it as cell editor in cxGrids because of the separation Description/Value.)

Upvotes: 2

Uwe Raabe
Uwe Raabe

Reputation: 47819

Raize Components have TRzComboBox which introduces a Values property as an addition to the existing Items.

Upvotes: 1

Related Questions