Provo a postare un po di codice:
qua premo il bottone che mi crea una nuova riga nella stringgrid
procedure TTfInseMovConta.BtNewRowClick(Sender: TObject);
begin
inc(NumeroRiga);
SgMovCon.RowCount:=NumeroRiga;
SgMovCon.SetFocus;
end;
ora il comando passa alla stringgrid
rocedure TTfInseMovConta.SgMovConEditingDone(Sender: TObject);
begin
cl:=SgMovCon.Col;rg:=SgMovCon.Row;
case cl of
0: ;
2;
3:begin
dato:=UpperCase(SgMovCon.Cells[cl,rg]);
.
.
.
AggiornaSaldoConto;
if ord (MovOk.Ctp[NumeroRiga].Segno)=0 then dato:='DARE'
else dato:='AVERE';
SgMovCon.Cells[cl,rg]:=dato;
BtNewRow.Refresh;
BtNewRow.SetFocus;
end;
end;
end;
ho omesso un po' di codice dei punti 0,1,2 giusto per non far confusione