Recent

Author Topic: Accessing a cell  (Read 3260 times)

MM38

  • Newbie
  • Posts: 1
Accessing a cell
« on: September 15, 2015, 05:15:06 pm »
Hi
With TStringGrid, it 's possible to access directly to a cell with a ligne like

 Grid.Cells[Col,Row]:=ChaineTemp;

How can I do the same thing with FPSpreadsheet?  I want to to use tsworksheetgrid. On a web site, II saw a line
with a function writenumber(x,y,number). But it's a methode of  tsworksheet.
So Im lost !!!

Can you help me?

Thanks
 


wp

  • Hero Member
  • *****
  • Posts: 13486
Re: Accessing a cell
« Reply #1 on: September 15, 2015, 07:09:18 pm »
No, there is no "Cells" property in fpspreadsheet for historical reasons. In order to write a value (a number in the following example) you call the worksheet method

Code: [Select]
  myworksheet.WriteNumber(row, col, number);

which means "write the number into the cell at the specified row and column index". Different words but the same meaning as with the "Cells" of a grid...

In comparing with TStringGrid usage, you must be aware that row and column indexes are interchanged and - if the grid has fixed rows/columns - are offset by 1.

 

TinyPortal © 2005-2018