Board index » delphi » Using DBGrid

Using DBGrid

Hi,

I am using a DBGrid that contains the columns ItemNo, ItemDescription,
ItemPrice, ItemQty and ItemAmount.  Column ItemAmount is a calculated column
using ItemQty and ItemPrice.  However, when I modify ItemQty for a specific
row, ItemAmount is updated and displays but when I leave that specific row,
I loose ItemAmount ( goes blank ).  Anyone with code of how to use the
calculate field in a DBGrid such that when I change the contents of a
ItemQty column, the results are reflected and stay in ItemAmount?

Thank,
Bob.

 

Re:Using DBGrid


Hi,

you will have to create a calculated field in the item table. And
use the OnCalcFields event of the table to calculate the result
for this created field.

Greetings,

Rob Segerink

Quote
Robert Okemo wrote in message <8hl42u$97...@hfc.pacific.net.hk>...
>Hi,

>I am using a DBGrid that contains the columns ItemNo, ItemDescription,
>ItemPrice, ItemQty and ItemAmount.  Column ItemAmount is a calculated
column
>using ItemQty and ItemPrice.  However, when I modify ItemQty for a specific
>row, ItemAmount is updated and displays but when I leave that specific row,
>I loose ItemAmount ( goes blank ).  Anyone with code of how to use the
>calculate field in a DBGrid such that when I change the contents of a
>ItemQty column, the results are reflected and stay in ItemAmount?

>Thank,
>Bob.

Other Threads