能否设定stringGrid指定行或者列能输入?
stringgrid有3个列,为‘数量’‘单价’‘金额’,要在哪个事件中写代码(金额=数量*单价)

解决方案 »

  1.   

    在OnSelectCell事件写procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
      ARow: Integer; var CanSelect: Boolean);
    begin
      with StringGrid1 do
      begin
        if ARow = 1 then
          Options := Options + [goEditing]
        else
          Options := Options - [goEditing]
      end;
    end;
      

  2.   

        with stringgrid do
        begin
          Cells[0,0]:='数量';
          Cells[1,0]:='单价';
          Cells[2,0]:='金额';
        end;
    是这意思吗?DrawCell