> Is there any way to read each of the values of a column in a DBgrid?
> I have a DBGrid which displays detail records for a master record. I want to
> sum dollar values for each detail record, but I want this to happen quickly,
> since I want to call the routine for every character entry, so that I can
> enable the master records SAVE button once the totals sum to a certain figure.
> I dont want to change the detail tables dataset cursor since I am editing a
> record in it, and I would prefer to not use a second table. I cant see how to
> access the data from
>
> DBGrid1.Columns[1].Collection.items[count]
It's a dataset... The only data stored in memory should be the current row... There's
probably a way to get the values for the current page of information but other than
that
you're going to have to create a second dataset to traverse the values... SQL selecting
only that column and using sql to perform the sum would probably be the tidiest and
lend
itself to client-server (assuming you're not already there)...
can you calculate the values before editing starts and then use the edited values in
conjunction
with the precalculated value to determine the state of the save button...
--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz