LCL, check if dataset empty when deleting a record in dbgrid, from Boguslaw Brandys, issue #13246

git-svn-id: trunk@18870 -
This commit is contained in:
jesus 2009-03-02 14:09:21 +00:00
parent b3eb59ed47
commit f940156a21

View File

@ -1824,14 +1824,15 @@ begin
VK_DELETE:
begin
doOnKeyDown;
if (Key<>0) and (ssCtrl in Shift) and GridCanModify then
if (Key<>0) and (ssCtrl in Shift) and GridCanModify and
not FDataLink.DataSet.IsEmpty then begin
if not (dgConfirmDelete in Options) or
(MessageDlg(rsDeleteRecord, mtConfirmation, mbOKCancel, 0 )<>
mrCancel)
(MessageDlg(rsDeleteRecord, mtConfirmation, mbOKCancel, 0 )<>mrCancel)
then begin
doDelete;
key := 0;
end;
end;
end;
VK_DOWN: