mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 15:39:30 +02:00
lcl: TDBLookup - scroll dataset even if ControlLink not active
git-svn-id: trunk@34763 -
This commit is contained in:
parent
436bf0df59
commit
77a190e12c
@ -334,9 +334,11 @@ var
|
|||||||
Key: Variant;
|
Key: Variant;
|
||||||
SavedEvent: TNotifyEvent;
|
SavedEvent: TNotifyEvent;
|
||||||
begin
|
begin
|
||||||
if not FControlLink.Active or (ValueIndex < 0) or (ValueIndex >= Length(FListKeys)) then
|
if (ValueIndex < 0) or (ValueIndex >= Length(FListKeys)) then
|
||||||
Exit;
|
Exit;
|
||||||
Key := FListKeys[ValueIndex];
|
Key := FListKeys[ValueIndex];
|
||||||
|
if FControlLink.Active then
|
||||||
|
begin
|
||||||
if VarSameValue(Key, FControlLink.DataSet.FieldValues[FDataFieldNames]) then
|
if VarSameValue(Key, FControlLink.DataSet.FieldValues[FDataFieldNames]) then
|
||||||
Exit;
|
Exit;
|
||||||
SavedEvent := FControlLink.OnDataChange;
|
SavedEvent := FControlLink.OnDataChange;
|
||||||
@ -351,6 +353,7 @@ begin
|
|||||||
for I := 0 to FDataFields.Count -1 do
|
for I := 0 to FDataFields.Count -1 do
|
||||||
TField(FDataFields[I]).Value := Key[I];
|
TField(FDataFields[I]).Value := Key[I];
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
if ScrollDataset then
|
if ScrollDataset then
|
||||||
FListLink.DataSet.Locate(FKeyFieldNames, Key, []);
|
FListLink.DataSet.Locate(FKeyFieldNames, Key, []);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user