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
[bug_fixed] Master-detail close/open
Moderators: gto, cipto_kh, EgonHugeist, mdaems
greetings.
there is one more issue one can think about a matter mentioned.
it is a place where
is done. the thing is that when you do not create fields in dataset manually, they are being created when dataset opens and destroyed when it closes.
and some visual data-aware components (developer express ones, for instance) do not notice that fields they were binded to were re-created. It happens that way if Close\Open sequence happens in Disable\enable Controls block.
this leads to lost pointers and exceptions.
to solve this problems i manually change close\open sequence with REFRESH statement each time ZEOS DBO is updated to new version.
i've reported this for several times, but...
if respected developers would be so nice to test this micro-patch and add it to repository it would save me some time
thanx for attention.
there is one more issue one can think about a matter mentioned.
it is a place where
Code: Select all
begin
Close;
Open;
end;
and some visual data-aware components (developer express ones, for instance) do not notice that fields they were binded to were re-created. It happens that way if Close\Open sequence happens in Disable\enable Controls block.
this leads to lost pointers and exceptions.
to solve this problems i manually change close\open sequence with REFRESH statement each time ZEOS DBO is updated to new version.
i've reported this for several times, but...
if respected developers would be so nice to test this micro-patch and add it to repository it would save me some time
thanx for attention.
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
@zx,
I hope you're sure this works without side effects. Sounds logical and the test suite doesn't fail. So I committed it. (Rev 252)
Can you please log future bugs to the bug tracker? That what that thing is made for. You can find it here: http://zeosbugs.firmos.at/
When it's a new feature you invented it's welcome to the User Patches Forum.
@edwin : can you please test your code again with this patch? Just to make sure we're not doing stupid things.
I hope you're sure this works without side effects. Sounds logical and the test suite doesn't fail. So I committed it. (Rev 252)
Can you please log future bugs to the bug tracker? That what that thing is made for. You can find it here: http://zeosbugs.firmos.at/
When it's a new feature you invented it's welcome to the User Patches Forum.
@edwin : can you please test your code again with this patch? Just to make sure we're not doing stupid things.