Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stringgrid add column runtime D6

Status
Not open for further replies.

Vern45

Programmer
Sep 9, 2008
2
0
0
HI: Using DELPHI 6.

At runtime I want to INSERT and/or DELETE a column(s). My problem is that after I INSERT a column I immediately add text to 3 rows in the new column. However, it does not print, i.e. it remains blank. My code below:

procedure TEntWinForm.LWInsertClick(Sender: TObject);
begin
with sg3page1 do
begin
ColCount := ColCount +1;
Cells[ColCount,0] := '???';
Cells[ColCount,1] := '50' ;
Cells[ColCount,2] := '123456789~123456789';
end;
end;

Note: If I add a second column that columns rows are filled. Then if I delete a couple column followed by INSERTing columns, each column DOES have data in their respective rows.

Thank you, Vern
 
Solved!

Made ColCount = ColCount-1. That fixed it. I spent a couple days chasing it.

Tks Vern
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top