这是Ex-Ex上的回答,她是选择全部记录:
//enable multiselect (in dbgrid options) you can do below code on
//double click to selectall then.
procedure TForm1.DBGrid1DblClick(Sender: TObject);
begin
orders.DisableControls;
try
orders.First;
while not orders.EOF do begin
DBGrid1.SelectedRows.CurrentRowSelected := True;
orders.Next;
end;
finally
orders.EnableControls;
end;
end;