Description


Occurs when the user has finished editing a cell, such as selecting another cell or pressing Enter. Allows you to reject the entered value.


When editing a cell, the following chain of events is triggered: OnBeforeEdit > OnAplyEditText > OnEditAccept > OnAfterEdit


The parameters of this event contain an Accept parameter that allows you to reject a value entered in a cell.



Example


procedure Form1_TableGrid1_OnEditAccept (Sender: TObject; ACol, ARow: Integer; Value: String; var Accept: Boolean);
begin
   // prohibits entering empty values
   if Value = '' then Accept := False;


   // prohibits entering values shorter than 3 characters
   if Length(Value) < 3 then Accept := False;
end;