[bug_fixed] Master-detail close/open
Posted: 25.02.2007, 03:32
Hello,
When I change something in a Master Dataset (TZQuery), the focus of the DBGrid of its Detail Dataset always jumps to the first record. This happens because the Detail Dataset closes and opens when its Master Dataset changes. Could you improve this behaviour by changing this in the unit ZAbstractRODataset.pas:
procedure TZAbstractRODataset.RefreshParams;
var
DataSet: TDataSet;
begin
DisableControls;
try
if FDataLink.DataSource <> nil then
begin
DataSet := FDataLink.DataSource.DataSet;
if DataSet <> nil then
//if DataSet.Active and (DataSet.State <> dsSetKey) then <- old
if DataSet.Active and not (DataSet.State in [dsSetKey, dsEdit, dsInsert]) then // <- new
begin
Close;
Open;
end;
end;
finally
EnableControls;
end;
end;
Please test this code.
Thanks,
Edwin
When I change something in a Master Dataset (TZQuery), the focus of the DBGrid of its Detail Dataset always jumps to the first record. This happens because the Detail Dataset closes and opens when its Master Dataset changes. Could you improve this behaviour by changing this in the unit ZAbstractRODataset.pas:
procedure TZAbstractRODataset.RefreshParams;
var
DataSet: TDataSet;
begin
DisableControls;
try
if FDataLink.DataSource <> nil then
begin
DataSet := FDataLink.DataSource.DataSet;
if DataSet <> nil then
//if DataSet.Active and (DataSet.State <> dsSetKey) then <- old
if DataSet.Active and not (DataSet.State in [dsSetKey, dsEdit, dsInsert]) then // <- new
begin
Close;
Open;
end;
end;
finally
EnableControls;
end;
end;
Please test this code.
Thanks,
Edwin