Lazarus
Programming => Databases => Topic started by: 99Percent on August 25, 2010, 01:53:35 am
-
the current LCL's TDBLookUpComboBox does not have KeyValue property. This is very unfortunate and I think very badly needed. I am considering taking the time to implement it myself, but before I would like to know if there are any (open source) third party components which have a more advanced DBLookUpComboBox
Another deficiency is no way to limit to the lookup items. A user can fill the text box with useless characters that don't specify any record of the listsource.
-
You're searching 4
DBLookupComboBox1.Field.Value
In fact the key_field value is the real datafield associated to the component! So you need only to look at the current value in the query/table.
If u want the listfield just look at
DBLookupComboBox1.Caption
Bye
-
Thanks.
I forgot to mention that I want to use the DBLookUpCombo Box without a datasource, using the listsource only.
-
You can get the index field (or other field) directly from the source table.
Example:
myTable.RecNo := myDBCombo.ItemIndex + 1;
indexvalue := myTable.FieldByName(myDBCombo.KeyField).Value;
8-)
-
Thanks but DBLookUpComboBox.KeyValue seems to be implemented in the lastest SVN versions. I will try it soon.
-
How I update the version of lazarus with dblookupcombobox.keyvalue when have.
-
Thank's Juan Parati, I tested your code and worked perfect