Без защиты от набора букофф
Код:
procedure TForm1.StringGrid1SetEditText(Sender: TObject; ACol,
ARow: Integer; const Value: String);
begin
if (Value <> '') and
(StrToInt(Value) > StrToInt(Edit1.Text)) then
StringGrid1.Cells[ACol,ARow]:= Edit1.Text;
end;
procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9',#8]) then Key:= #0;
end;
а на KeyPress можно повесить проверку ввода цифирок и возвращать Key = #0, если не они клацаются