I have following code:
var
cbMyCombo: TcxLookupComboBox;
I have a dataset which has following query:
SELECT ID, NAME from MYTABLE;
This query works fine.
Now I have done binding in cbMyCombo in DFM file as following:
object cbMyCombo: TcxLookupComboBox
Properties.KeyFieldNames = 'ID'
Properties.ListColumns = <
item
FieldName = 'NAME'
end>
end
It works fine and combobox is binded. My problem is, nothing is selected by default. I want that initially combobox should contain "View All" option.
I am trying like this:
cbMyCombo.Text := 'View All'
But, this is not setting anything because "View All" is not the part of the list which I have binded to it. I want to manually add "View All" as FieldName
and 0 as KeyFieldName
and this should be selected by default. How can I do this?
您应该在数据集中添加'View all', 0
行,并在初始化中将组合框的EditValue
设置为0。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.