Selected item in TDBComboBox when TDataSet are browse
Original Reporter info from Mantis: giovanni.seara
-
Reporter name: Giovanni Seara
Original Reporter info from Mantis: giovanni.seara
- Reporter name: Giovanni Seara
Description:
If TDataSet is navigated and the value of a TField is changed through a TDBComboBox, the state of the TDataSet changes to edit, but the value of the TField is not modified.
It has been identified that the problem is related to the RecordChange event and the TFielDataLink Reset method.
The problem is caused because when the UpdateData method of TFieldDataLink is called the variable IsModified is set to "False", so the value of the TField is not changed.
The temporary fix is to force the value of the IsModified variable to "True" when the Select method of the TDBComboBox is executed.
(...\lazarus\lcl\include\dbcombobox.inc - Line 60)
procedure TDBComboBox.Select;
begin
...
FDataLink.OnDataChange := nil;
try
if FDataLink.Edit then
begin
if not FDataLink.IsModified then
FDataLink.Modified;
FDataLink.UpdateData;
...
end;
Steps to reproduce:
1 - Stay the state of TDataSet in browse.
2 - Set the value of TField through the TDBComboBox.
3 - The state of TDataSet will be editing and the value of TField not will be modify.
Mantis conversion info:
- Mantis ID: 33160
- OS: Windows
- OS Build: 10
- Version: 1.8