Tonyw, it's about performance, no editing at all.
Especially performance is not good when you have Master/Detail concept and Detail query is relatively slow.
I found some solutions though. As VirtualDBGrid does not change active record (Cursor), it's better to use it instead of DBGrid. Master/Detail concept is still not very fast, even when using VirtualDBGrid, because looks like Detail DataSource still scrolling or refreshing (not sure) when scrolling Master grid and that makes delays and scrolling is not smooth.
Solution - disable controls of Detail DataSet when scrolling Master grid, and enable controls with timer (interval 500) after scrolling is finished (didn't find better solution with using any combination of Grid and DataSet events):
procedure TForm1.Timer1Timer(Sender: TObject);
begin
SQLQueryDetail.DataSource := DataSourceMaster; {Looks like no need on linux}
SQLQueryDetail.EnableControls;
Timer1.Enabled := False;
end;
procedure TForm1.VirtualDBGrid1Scroll(Sender: TBaseVirtualTree; DeltaX,
DeltaY: Integer);
begin
if not SQLQueryDetail.ControlsDisabled then
begin
SQLQueryDetail.DataSource := nil; {Looks like no need on linux}
SQLQueryDetail.DisableControls;
end;
Timer1.Enabled := False;
Timer1.Enabled := True;
end;
This works, but there is disadvantage. Active record in Detail grid will get back to first record after scrolling Master.
Another solution is using DataSet without Master/Detail concept. So both data sets are separate and Detail data set is reloaded when Master active record is changed (Master grid OnClick). DataSource property of Detail Dataset is None (no Master/Detail concept).
procedure TForm1.VirtualDBGrid1Click(Sender: TObject);
begin
SQLQueryDetail.Active := False;
SQLQueryDetail.ParamByName('id').AsString := SQLQueryMaster.FieldByName('id').AsString;
SQLQueryDetail.Active := True;
end;
This solution is better if performance is main thing.
It is quite usual thing to scroll grids when working with databases and searching for record you need, so it's quite strange that scrolling of grids and data sets are made this way. If I'm not mistaken the same is in Delphi and it was always like this. Maybe there is even reason for this, though I don't know it yet.
Also it looks like VirtualDBGrid does not work with Zeos components, but I din't test different versions of Zeos, so probably it'a an issue only in trunk version. But that's another question.