0

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.

Livebinding

Both combobox3 and stringgrid2 are linked

when i click on XMPS combobox list is ok (combobox and stringgrid show same things ) combobox ok

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

but when i click on combobox , it list the previous data when stringgrid is correct enter image description here

Has anyone faced this problem ? What have i done wrong ? Is this a bug ?

Thanks Claude

Eski
  • 97
  • 3

2 Answers2

0

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

  • Already confirmed, tested by me, that this problem is solved in version 11 alaxandria and everything works as it should. – Carlos Díaz Feb 26 '22 at 18:47
0

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.