eelias Posted November 25, 2013 Share Posted November 25, 2013 Hi there! I have a master detail form with a dbgrid connected to a DBISAM TTable. The master grid has a column TOTAL, that is linked to the same column on the TTable. It is a calculated field On the OnCalcFields i have a loop on the detail table (another DBISAM TTable) that calculates the total and stores the value on the master: procedure TDMMainG.TablePedidoCalcFields(DataSet: TDataSet); var total : Currency; begin total := 0; TablePedidoItPesq.First; while not TablePedidoItPesq.Eof do begin total := total + (TablePedidoItPesq.FieldByName('valor').AsCurrency * TablePedidoItPesq.FieldByName('qtd').AsFloat); TablePedidoItPesq.Next; end; DataSet.FieldByName('total').Value := total; end; With a breakpoint on this code I can see that the TOTAL is getting calculated right. However on the DBGrid is shows only one value as the same for all rows. Sometimes the first, sometimes the last. I have not found why. I have tried fetchall, recno, etc and in any situation is the same. What can I do to fix this situation? Thanks Eduardo Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted November 25, 2013 Administrators Share Posted November 25, 2013 Test same thing in a standard Delphi application. If you find that this is a uniGUI bug please open a report in Bug Reports forums with a test case. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.