Retrieve Cell Contents from TDBGrid [SOLVED] lazarus / 16-Databases ---------------------------------------------------------------------- PaulW · 2011-05-13 02:00 Lazarus 0.9.31; FPC 2.4.2; Windows Vista Should be simple enough, but I can't seem to find the solution. I have a TDBGrid with 10 rows and 5 columns.  When I double-click a cell (or row if dgRowSelect=true), how do I retrieve the contents of a specific cell for the row selected? MyTDBGrid.SelectedField returns the contents of the cell clicked, but I need to get the contents of another cell in the same row.  For example, the cell clicked might be column-3, but I need the contents of the cell in column-0.MyTDBGrid.SelectedIndex returns the column number of the cell clicked (not the row number as the documentation would suggest). I can't find a function that reads the cell contents for a specific row/column. Thanks for the help. ---------------------------------------------------------------------- exdatis · 2011-05-13 05:53 if not(DBGrid1.DataSource.DataSet.Fields[0].Value = NULL) then             some_value:= DBGrid1.DataSource.DataSet.Fields[0].Value; just set fields[index] ---------------------------------------------------------------------- PaulW · 2011-05-13 17:18 @exdatis: Thanks for your help.  That solved my problem. Sure would like to find some good documentation regarding database use in Lazarus.  (I'm using SQLite3.) ---------------------------------------------------------------------- exdatis · 2011-05-13 19:30 http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial or http://zeos.firmos.at/portal.php   great db_lib ---------------------------------------------------------------------- PaulW · 2011-05-13 20:50 @exdatis: I need the same functionality for the DBGrid's OnCellClick event.  It seems that the OnCellClick doesn't get called when I click on a cell in the DBGrid.  So I put a ShowMessage() in the event's code to monitor it.  I noticed that the OnCellClick gets fired on the second click of a cell (not double-click).  Think "click {pause} click". not "click-click".  I don't understand what's going on.