lcl: TDBLookup - scroll dataset even if ControlLink not active

git-svn-id: trunk@34763 -
This commit is contained in:
blikblum 2012-01-16 20:18:13 +00:00
parent 436bf0df59
commit 77a190e12c

View File

@ -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;