View Full Version : DBCombobox با امکان نمایش بیش از یک فیلد؟
kheyri
پنج شنبه 19 بهمن 1385, 09:32 صبح
سلام دوستان
آیا روشی وجود دارد که بتوان دو یا چند فیلد از یک تیبل را در یک DBCombobox نمایش داد؟
nasr
پنج شنبه 19 بهمن 1385, 09:39 صبح
آیا منظورت اینه که مثلا نام و فامیل که در دو تا فیلد قرار دارند را داخل یک DBCombobox بچسبونی به هم و نشون بدی؟
kheyri
پنج شنبه 19 بهمن 1385, 10:33 صبح
بله درسته . و یا مثلاً اسم و فامیل و شغل .
nasr
پنج شنبه 19 بهمن 1385, 11:17 صبح
بهتره بگذاری توی یک Combobox و خودت این 3 تا را اضافه کنی
Combobox1.items.add(table1.fieldbyname('name').ass tring + ' ' + table1.fieldbyname('Family').asstring);
Mohammadi_F
پنج شنبه 19 بهمن 1385, 12:32 عصر
توی سایت About بخش Delphi مقاله ای در این باره وجود داره ولی آدرسش رو الان ندارم خودت سرچ کن ببین می تونی پیداش کنی؟
mehranFX
پنج شنبه 19 بهمن 1385, 12:44 عصر
من فرض میکنم منظورت کنترل DBLookupComboBox هست ، و با این فرضیات مطلب زیر رو که در رابطه با خاصیت ListField این کنترل هست را مطالعه کن !
The lookup control represents a field in one table by displaying the value of one or more corresponding fields in another table. ListField is the name of the field or fields in the lookup table that are actually displayed, as opposed to the DataField, which is the field in the DataSource that the lookup control actually represents, or the KeyField, which is the field in the lookup table with the same value as the DataField.
To fully specify the list fields, both a dataset for the lookup table and the fields within that dataset must be defined. The ListSource property of the lookup control specifies the dataset for the lookup table.
ListField can represent more than one field. Separate multiple field names with semicolons(;).
Before specifying ListField, specify the link between the two datasets using the KeyField property. If ListField is not set, lookup controls display KeyField field values by default. If the DataField field is a lookup field, don't specify anything for ListField; the data controls automatically use the lookup field's LookupResultField property as ListField.
kheyri
یک شنبه 29 بهمن 1385, 14:47 عصر
ممنونم از راهنمائیتون. خوشبختانه با مراجعه به مقاله به آدرس زیر تونستم مشکل رو حل کنم :
http://delphi.about.com/od/database/l/aa090401c.htm
moradi_am
جمعه 04 اسفند 1385, 13:01 عصر
در lookup field این مسئله چطور حال میشود (یعنی دوفیلد در فیلد lookup ذخیره شود )
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.