delphi 右键删除dbgrid行

Delphi DBGrid右键删除行并提交至数据库.
在form上添加,控件TPopupMenu,并指定右键名称:删行

2.编写删除语句:   

    If ADOQuery1.State in [dsEdit, dsInsert] then ADOQuery1.Post;
    If ADOQuery1.RecordCount <> 0 then ADOQuery1.Delete;

3.把dbgrid的PopupMenu属性,设置成刚刚添加的控件TPopupMenu。

4.编译,运行

原文地址:https://www.cnblogs.com/jijm123/p/7538490.html