Posted by Milsdam on October 07, 2007
Here’s my problem.
I have four columns of a StringGrid control corresponding to four Edit boxes.
When I go down one row in the SG, how do I change the EditText accordingly?
I’ve tried something like this:
procedure TForm1.DownClick(Sender: TObject); var Row : Integer; begin if StringGrid1.Row < StringGrid1.RowCount -1 then StringGrid1.Row := StringGrid1.Row +1 else Beep; Row := Row +1; Edit1.Text := StringGrid1.Cells[0,Row]; Edit2.Text := StringGrid1.Cells[1,Row]; Edit3.Text := StringGrid1.Cells[2,Row]; Edit4.Text := StringGrid1.Cells[3,Row]; end;
The onClick works fine for the StringGrid row change, however the Edit boxes stay empty.
Please help.
Follow Ups