TDBGrid get value from row lazarus / 16-Databases ---------------------------------------------------------------------- catosp · 2011-09-11 08:10 Hello everybody ! I have a huge problem wich sound like this : I have a database and aTDBGrid with 3 columns. Each columns have 10 records and the problem is how can i get the value from row 3 wich is situated in column 2 ? Please help me ... Thanks ! ---------------------------------------------------------------------- exdatis · 2011-09-11 10:39 Two ways, one can read the value of the selected record:     data_set.field_name.value (or data_set.fields[index_of_fields].value)  or    if not(DBGrid.DataSource.DataSet.Fields[index_of_fields].Value = NULL) then             some_var:= DBGrid.DataSource.DataSet.Fields[index_of_fields].Value; ---------------------------------------------------------------------- catosp · 2011-09-11 10:43 Yes...but i don't wanna read the value of a selected row. I wanna read a custom cell from DBGrid. Example Column 2 and row 5 even the selected row is from column 2 and row 2. Sorry for my bad english. ---------------------------------------------------------------------- m.vincent · 2011-09-19 14:22 Catosp, I think the code posted by exdatis should get you started to doing what you want to do. All the info is there. However, I think you are going about this the wrong way. Embedding numbers to rows and columns of a dataset is asking for trouble in the future.  A better way would be to construct a SQL query which returns the value you want independent of your GUI elements. Kind regards, Mike