Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I abort deletion of record based on decisions after dbnavigator delete button pressed?

Can I abort deletion of record based on decisions after dbnavigator delete button pressed? I checked beforeAction Event

if Button = nbDelete then  
  //check if not OK then

Button := nbCancel;

but it doesn't work. Any Help?

I'm using DelPhi XE2, anyDac Components

like image 410
ae1080 Avatar asked Jan 13 '13 07:01

ae1080


1 Answers

Use the BeforeAction event

procedure TForm1.DBNavigator1BeforeAction(Sender: TObject; Button: TNavigateBtn);
begin
  if Button = nbDelete then
  begin
    if MessageDlg('Confirm delete now?', mtConfirmation, [mbYes,mbNo], 0) = mrNo then
    begin
      Abort;
    end;
  end;
end;
like image 181
dataol Avatar answered Oct 05 '22 23:10

dataol