0

A listview is bound to BindSourceDB with a TFDTable as dataset. The listview does show the data from the dataset as expected. However, when adding a new record to the dataset the binding does not automatically refresh the table: so the new record is not visible in the listview.

The record is added as follows:

DM.tbl_ExamQuestions.AppendRecord([
  0,
  StrToInt( ExamID ),
  DM.FDQuery.FieldByName('question_id').AsInteger,
  '-'
]);

Using TBindings.Notify( BindSourceDB, '') does not trigger the refresh.

Using TBindNavigator to add a record does repopulate the list.

How can I have the listview update itself in order to show the newly added record?

mjn
  • 36,362
  • 28
  • 176
  • 378
Hans
  • 9
  • 2

1 Answers1

0

Try DM.FDQuery.UpdateTransaction;

Haizhou
  • 21
  • 2