RAD Studio VCL Reference
|
Occurs before an application enters edit mode for the active record.
property BeforeEdit: TDataSetNotifyEvent;
__property TDataSetNotifyEvent BeforeEdit;
Write a BeforeEdit event handler to take specific action before an application enables editing of the active record. For example, an application that keeps a log of database edits could use the BeforeEdit event to record the edit request, time, and user before entering edit state.
Delphi Examples:
{ This example adds an entry to a memo with a message when an AfterEdit event occurs and when a BeforeEdit event occurs. Click on Run SQL to populate the DBGrid. Then select a cell to edit and click the Edit current cell button, or just start editing the cell to invoke the BeforeEdit and AfterEdit events. } procedure TForm1.ClientDataSet1AfterEdit(DataSet: TDataSet); begin Memo2.Lines.Add('After editing record' + IntToStr(DataSet.RecNo)); end; procedure TForm1.ClientDataSet1BeforeEdit(DataSet: TDataSet); begin Memo2.Lines.Add('Before editing record' + IntToStr(DataSet.RecNo)); end; procedure TForm1.Button4Click(Sender: TObject); begin ClientDataSet1.Edit; end;
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|