DBAdvGrid.Appendonarrowdown works only once

I want that in a dbadvgrid, when the user presses keydown, a line is inserted. I have activated Grid.Navigation.AppendOnArrowDown.

The problem I have is that it only works once. If I go to the last line of the DBAdvGrid and press KeyDown a new record is inserted (* I assign the primary key in DataSet.NewRecord and do DataSet.Post), but if I press again a new record is not inserted, I have to press KeyUp and then going down 2 times if it is inserted.

I have tried everything, refresh table, reload the DBGrid,...

  • With Search Footer.Visible = True if it works as I want, pressing keykdown n times inserts n lines.

We'll need more details. We tested this here with the Demo\DBAdvGrid\CDSEditing demo but could not see such problem here. What is different in your app?

Hello, what I want to achieve is that the user can insert into a table, whose primary key is an integer with autoincrement (I assign the maximum value by code), "empty" records (only with the line number).

***What I want to achieve:

  • Go to the last line of the DBAdvGrid.
  • Press KEYDOWN.
  • A line is inserted with line number max(line_number)+1
  • I press KEYDOWN again.
  • A line with line number max(lin_number+1) is inserted
  • And so on...

So that the user can insert empty lines (only with the line number) in an invoice, for example. To achieve this I make Grid.Navigation.AppendOnArrowDown=True and in DataSet.OnNewRecord I assign the line number (primary key).

What happens to me:

  • Go to the last line of the DBAdvGrid.
  • Press KEYDOWN.
  • A line is inserted with line number max(line_number)+1
  • I press KEYDOWN again.
  • Line number is NOT inserted, for the AppendOnArrowDown to work, I have to go up and down again.

I have modified the CDSEditingDemo application so that when inserting a new record it assigns a value to the "primary key" (ZCountry+n) and the same thing happens to me, the AppendOnArrowDown only works once, for it to work again I have to go up and down.
CDSEditing.zip (3.0 MB)

All the best.

** An addition:

In CDSEditingDemo it doesn't work the way I want when displaying the SearchFooter, which it does (if it works the way I want), in my application (Firebird2.5, tested with Zeos and Firedac components)

I did this change in the initialization of the CDSEditing demo to make it work with a search footer

procedure TFormMain.FormCreate(Sender: TObject);
begin
//  GridCountry.FloatingFooter.Visible := true;
  CdsCountry.Active := true;
  CdsCountry.LogChanges := False;
  GridCountry.FloatingFooter.Visible := false;
//  GridCountry.FloatingFooter.ColumnCalc[4] := acSum;
  GridCountry.SearchFooter.Visible := true;

but I can still not see an issue when pressing arrow down to insert a new record.

Does two consecutive Keydown presses insert two records? (with hidden searchfooter)

Adjunto video explicativo
ScreenRecorderProject3.zip (2.6 MB)

I still cannot reproduce. Our test app is attached.
dbadvgridappendonarrowdown

Project1.zip (2.9 MB)