AdvStringGrid

I check a cell's value using the onCellValidate.

It works fine except it is always executed twice, the second time after closing the ShowMessage. I need to show the user a message if the text is of a given value.

How can I prevent the event executing twice?

procedure TForm1.AdvStringGrid1CellValidate(Sender: TObject; ACol,
ARow: Integer; var Value: string; var Valid: Boolean);
begin
valid:=false;
if value<>'1' then ShowMessage('Wrong value');
end;

Regards,
Ole

You should NEVER call ShowMessage() from OnCellValidate.
ShowMessage() takes the focus away from the grid and taking the focus away from the grid in itself causes the editing to stop (again).
Messages should be shown from OnEditCellDone