下拉选择中的多个值字段 [英] Multiple Valuefields in DropDown Selection
本文介绍了下拉选择中的多个值字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在DropDown中,我想传递多个Value字段.如何通过
例如:
Hi,
In DropDown i want to pass the multiple Value fields . How to pass
Ex:
Job Code (PK) Item Code (PK) Item
1 1 A
1 2 B
1 3 c
2 1 D
2 2 c
ddl.TextField ="Item"
ddl.Valuefield ="...."
请帮助我解决此问题...
ddl.TextField="Item"
ddl.Valuefield="...."
Please help me to solve this issue...
推荐答案
以下链接应为您提供一些想法.
从asp.net中的数据库填充下拉列表 [^ ]
从数据库填充下拉列表 [ ^ ]
The below links should give you some idea.
Populate Dropdownlist from Database in asp.net[^]
populate a Dropdown list from database[^]
无法执行此操作.您可以选择以下选项.
从数据库中检索时,将两个列值选择/合并为单个,并以特殊字符分隔,然后将该列值作为下拉列表中的value字段.
例如
从表中选择(作业代码+'';''+项目代码)作为代码,项目.
设置valueField ="Code'';
设置textfield =``Item'';
在撤消下拉选择的值时,只需用'';''分割即可.
问候
There is no way to do this.. you can have following option.
select / merge two column values into a single with separating with special character while retriving from database and then assing that column value as value field in dropdown.
e.g.
select (Job Code + '';'' + Item Code) as Code,Item from Table.
set valueField=''Code'';
set textfield = ''Item'';
while retring dropdown selected value, just split with '';''.
Regards,
这篇关于下拉选择中的多个值字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文