'how can i solve my Livebinding and combobox problem
i have a dataset ( mysql ) bind with a combobox , i have seen a problem on it so i add a stringgrid to demonstrate the problem.
when i click on XMPS combobox list is ok (combobox and stringgrid show same things )

when i click on XMPSSCO combobox and stringgrid show the single result , this is ok

but when i click on combobox , it list the previous data when stringgrid is correct

Has anyone faced this problem ? What have i done wrong ? Is this a bug ?
Thanks Claude
Solution 1:[1]
The same thing happens to me in D10.4
Try DropDownkind property from the ComboBox. Change from Native to Custom.
TComboBox.DropDownKind = Custom
Only that. It works for me. Ugly in android but you solve while you look for more options.
Alternatives: Woll2woll components or try in the new Delphi D11
Solution 2:[2]
I found the same pain in other forums. Going through the TComboBox code, I found that livebindings doesn't trigger the Change event (for some reason);
Add a ComboBox.Items.Add(''); before the .execute of the dataset (this forcing the change event) and it works.
MyComboBox.Items.Add(''); //Force the trigger OnChange
MyDataSet.Execute;
I like this solution more than the previous one, because you keep the native mode.
I understand that it should be something provisional, but it is 1 line, and it solves this penalty for the moment.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Carlos Díaz |
| Solution 2 |


