0
votes

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?

1

1 Answers

0
votes

Try DM.FDQuery.UpdateTransaction;