【问题标题】:How to update TListview after adding record to TFDTable?将记录添加到 TFDTable 后如何更新 TListview?
【发布时间】:2014-11-24 21:47:50
【问题描述】:

列表视图绑定到BindSourceDBTFDTable 作为数据集。 列表视图确实按预期显示了数据集中的数据。 但是,当向数据集添加新记录时,绑定不会自动刷新表:因此新记录在列表视图中不可见。

添加记录如下:

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

使用TBindings.Notify( BindSourceDB, '') 不会触发刷新。

使用TBindNavigator 添加记录会重新填充列表。

如何让列表视图自行更新以显示新添加的记录?

【问题讨论】:

    标签: delphi firemonkey livebindings


    【解决方案1】:

    试试 DM.FDQuery.UpdateTransaction;

    【讨论】:

    • 如何更新 ListView?究竟是从什么开始的?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-18
    • 2014-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多