if table1.eof then
  if down then
     table1.Last

解决方案 »

  1.   

    to Tiga 
      您的这段代码要写在哪个事件中(请详细)
      

  2.   

    我觉的,你应该不要用它的这个,要编辑、添加、删除的话,自己写;
    DBGrid.ReadOnly := True;
    不要依赖DBGrid的自身的功能;
      

  3.   

    procedure TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if key=40 then
      begin
        if DBGrid1.DataSource.DataSet.Eof then
          key:=0;
      end;
    end;
      

  4.   

    你不用寫任何代碼都可以,隻要設定屬性就可以,一般readonly為false就可以了。
      

  5.   

    procedure TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if key=40 then
      begin
        if DBGrid1.DataSource.DataSet.Eof then
          key:=0;
      end;
    end;