TDbLookupComboBox或具有一组固定值的等效控件? [英] TDbLookupComboBox or equivalent control with a set of fixed values?

查看:112
本文介绍了TDbLookupComboBox或具有一组固定值的等效控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在类似TDbComboBox的控件,该控件通过固定列表获取其显示值(用于枚举类型,例如TSomeValueEnum = (svSmall=1, svMedium=2, svLarge=3))?

Does a TDbComboBox-like control exist, that gets its displayed values by an fixed list (to use for an enumerated type, e.g. TSomeValueEnum = (svSmall=1, svMedium=2, svLarge=3))?

例如:

1=small
2=medium
3=large

在数据库中保存1或2或3,但是在组合框中仅应显示相应的值.

In the database I save 1 or 2 or 3, but in the ComboBox only the corresponding value should be displayed.

推荐答案

升级组件有一个TRzDbComboBox,其中有单独的项目和值列表.

Raize Components has a TRzDbComboBox where you have separate lists for Items and Values.

从帮助中:

TRzDBComboBox确实支持Values属性,该属性可用于定义要存储在选定数据库字段中的关联值列表,而不是在Items列表中维护的字符串值.例如,项目"列表可以设置为包含以下项目:Visa,万事达卡,美国运通卡;而值"列表将包含以下值:VISA,MC,AMEX.如果用户在下拉菜单中选择了美国运通卡项目,则AMEX值将存储在数据库表中.

The TRzDBComboBox does support a Values property, which can be used to define a list of associated values to be stored in the selected database field instead of the string values maintained in the Items list. For example, the Items list could be set up to contain the following items: Visa, MasterCard, American Express; while the Values list would contain the following values: VISA, MC, AMEX. If the user selected the American Express item in the drop down, the AMEX value would be stored in the database table.

这篇关于TDbLookupComboBox或具有一组固定值的等效控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆