Database Programming Techniques > Accessing and Manipulating Cell Data > Reading cell data from non-current records |
You can read cell data from non-current rows by using the Column object's CellText and CellValue methods. Note that you can only read data from non-current rows; you cannot update them. (The Text and Value properties are used to read and write values within the current row.)
To examine cell data in any row, where bkm is the bookmark of the desired row:
Example Title |
Copy Code
|
---|---|
,pre>RowText$ = TDBGrid1.Columns(ColIndex).CellText(bkm) RowValue = TDBGrid1.Columns(ColIndex).CellValue(bkm) |
The CellText method returns a formatted string (according to the column's NumberFormat property) exactly as it appears in the cell. The CellValue method returns the unformatted cell data as a string variant.