Posted by Jenny on September 15, 2005 In Reply to: help, how to align first column of stringgrid? posted by robert on September 13, 2005 : I need write the numbers of rows in the first column of a string grid how a spreadsheet : I use the following piece of code to write floats in the other columns but i don't know how write integers. : if Grid.Cells[ACol,ARow] <> '' then begin The first column is number 0. And let's suppose that you have one fixed row at the top. var R: integer; begin for R := 1 to Grid.RowCount - 1 do Grid.Cells[0, R] := IntToStr(R); However, this does not right-align these numbers. If you also want to right-align column 0, just add 1 line to your OnDraw event handler: if Grid.Cells[ACol,ARow] <> '' then begin bEsNum := True; sCad := Grid.Cells[ACol,ARow]; if ACol > 0 then // add this line // and leave the rest as it was Succes! Related Articles and Replies
|