Is there a ComboBox that has Items like a TcxRadio

2019-06-14 01:53发布

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.

4条回答
再贱就再见
2楼-- · 2019-06-14 02:29

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.

查看更多
forever°为你锁心
3楼-- · 2019-06-14 02:32

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

查看更多
不美不萌又怎样
4楼-- · 2019-06-14 02:46

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).

查看更多
萌系小妹纸
5楼-- · 2019-06-14 02:50

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.)

查看更多
登录 后发表回答