What I tried to achieve is like setting ItemIndex to -1 as like in normal ComboBox, so that the selected item will be cleared.
There is no ItemIndex for DBLookupComboBox, and the Text property is read only. So how do I clear the selected item? Please help. Many thanks in advance.
PS: Closing and reopening the DBLookupComboBox->ListSource DataSet does not help.
Two ways:
1) at runtime: DbLookupComboBox.KeyValue := null;
2) at design-time: set the DbLookupComboBox.NullValueKey property to DEL (or whatever key you want to use to null the value during runtime)
You can use
DBLookupComboBox.KeyValue := -1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With