Board index » delphi » TDBCtrlGrid problem

TDBCtrlGrid problem

I'm using D5.

I need to do some math operations and determine a person's age from the
birthday and place it in a string field control stored in a paradox db.  But
I can not seem to figure out how to get access to the data before it is
displayed into the TDBCtrlGrid fields.

I currently have a poor work around, I can assign an event (onclick) in the
TDBCtrlGrid. So when I click on a row in the control, it applies the math,
birthday operations correctly only to the row I clicked on, not to all the
rows currently displayed in the grid.

 

Re:TDBCtrlGrid problem


| I need to do some math operations and determine a person's age from the
| birthday and place it in a string field control stored in a paradox db.
But
| I can not seem to figure out how to get access to the data before it is
| displayed into the TDBCtrlGrid fields.

| I currently have a poor work around, I can assign an event (onclick) in
the
| TDBCtrlGrid. So when I click on a row in the control, it applies the math,
| birthday operations correctly only to the row I clicked on, not to all the
| rows currently displayed in the grid.

Try adding a calulated field - why are you storing age permanently
in the data base?

Double click on the ttable or tquery and add all of the fields you want
accessable by your dataset - then click add and set calculated to true.
This creates a dataset memory variable. You assign the new
TField value during the OnCalcFields event of the dataset.

Garry Kernan

Re:TDBCtrlGrid problem


Quote
>I need to do some math operations and determine a person's age from the
>birthday and place it in a string field control stored in a paradox db.  But
>I can not seem to figure out how to get access to the data before it is
>displayed into the TDBCtrlGrid fields.

Storing a person's age seems like a bad idea to me but If that is what you want
I would create a calculated field to compute the age then store the age in the
beforePost event.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads