Here's how to select the entire DBGrid from code:
~~~~~~~~~~~~~~~~~~~~~~~~~
procedure DBGridSelectAll(AGrid: TDBGrid) ;
begin
AGrid.SelectedRows.Clear;
with AGrid.DataSource.DataSet do
begin
DisableControls;
First;
try
while not EOF do
begin
AGrid.SelectedRows.CurrentRowSelected := True;
Next;
end;
finally
EnableControls;
end;
end;
end;
//Usage:
//DBGridSelectAll(DBGrid1) ;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» Delphi 8 IDE tricks - Error Insight
« How to open a password protected Paradox DB (if you do not know the password)

