Jump to content

kentiger

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by kentiger

  1. Hi, Hayri ASLAN

    UniDbgrid1 have 3 Column

          badno    badname    description

    My needs:

    When in the add mode, after the user enters the data in the Description, press the down button, the system automatically Append new record

    The following is my program

    procedure TMainForm.UniDBGrid1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    var
      isLastRecord: Boolean;
    begin
      isLastRecord := Abs((Sender as TUniDBGrid).DataSource.DataSet.RecNo) = (Sender as TUniDBGrid).DataSource.DataSet.RecordCount;
      if (Key = VK_DOWN) and (isLastRecord) and(TUniDBGrid(Sender).CurrCol=(Sender as TUniDBGrid).Columns.Count-1) then
      begin
        (Sender as TUniDBGrid).DataSource.DataSet.Append;
      end;
    end;

     

    An error message will occur as follows-->TuniCustomDBgrid.SetCellValue: RecNo Mismatch![4: -1].

     

    Please help, thank you

     

     

×
×
  • Create New...