Android smartphone

2009-10-08

Select all Fields in a TDBGrid

function GridSelectAll(Grid:
TDBGrid): Longint;
begin
Result := 0;
Grid.SelectedRows.Clear; with Grid.Datasource.DataSet do
begin
First;
DisableControls;
try
while
not EOF do
begin
Grid.SelectedRows.CurrentRowSelected := True;
inc(Result);
Next;
end;
finally
EnableControls;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
GridSelectAll(DBGrid1);

end;

No comments: