procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if DBGrid1.SelectedIndex = 可编辑的列 then
Include(DBGrid1.Options,dgEditing)
else
Exclude(DBGrid1.Options,dgEditing);
end;
双击DBGrid1,再加入所有字段,将除了要编辑的字段的ReadOnly设为False外,其它全为True
然后在DBGrid1KeyPress中加代码
procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
if not(ADOTable1.Eof) then
begin
ADOTable1.Next ;
DBGrid1.SelectedIndex:=x;//x为你的字段在 DBGrid1中的排位,从0开始
end;
end;
end;