?
Solved

DBGrid Cells

Posted on 1997-11-28
3
Medium Priority
?
862 Views
Last Modified: 2010-08-05
How to get the data of ONE cell of one DBGrid, to check in a table if this data already exists?
0
Comment
Question by:oberdan
3 Comments
 
LVL 4

Expert Comment

by:itamar
ID: 1352322
Please, could you elaborate the question a bit more. Give an example or more details
Thanks...
0
 
LVL 3

Accepted Solution

by:
Matvey earned 300 total points
ID: 1352323
I think that you can access the DBGrid cells
only from it's Fields property.
And if you want to check the new value that the user
enters in the current cell then you can use the
OnSetText Event of the TField Component.
This event is triggered befor the new field value
is posted into the edited table, so you can change,
format or discard the changes.
See help for details.         Good luck!
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1352324
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;
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question