Link to home
Start Free TrialLog in
Avatar of oberdan
oberdan

asked on

DBGrid Cells

How to get the data of ONE cell of one DBGrid, to check in a table if this data already exists?
Avatar of itamar
itamar

Please, could you elaborate the question a bit more. Give an example or more details
Thanks...
ASKER CERTIFIED SOLUTION
Avatar of Matvey
Matvey

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As itamar I don't fully understand the question, but here is a suggestion :

How to get data of one cell?

Well to get data from one cell you need to know which row and which column is selected :

 1. Row    : is the active record of the table
 2. Column : is the selected field of the dbgrid.

To get that value :

 CellString = Table1.GetFieldByName(dbGrid1.SelectedField.FieldName).AsString

or CellValue =

Table1.GetFieldByName(dbGrid1.SelectedField.FieldName).AsInteger

or ... depending on what type of field. You can check this with
 FIELDTYPE property of TField.

Having this data you can check in another table if it already exists with the normal search routines.

Have fun,
c.u. ZifNab;