今天一位朋友问了这个问题,现把解答的结果放在下面
with dbgrid do
for i:=0 to pred(componentcount) do
for i:=0 to pred(componentcount) do
begin
if components[i] is Tcustomedit then
begin
edit1.Text:= tedit(components[i]).Text;
if components[i] is Tcustomedit then
begin
edit1.Text:= tedit(components[i]).Text;
end;
end;