unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids;

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    procedure StringGrid1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);
begin
  case Key of
  #8,'0'..'9': ;
  ',':if Pos(',',Stringgrid1.Cells[StringGrid1.Col, StringGrid1.Row])>0 then Key:=#0;
  else
   Key:=#0;
  end;
end;

end.
