Topic: Tablegrid not updating correctly

Hi Dmitry,
In my application, I have a form with a parent grid and a child grid. 
The parent grid has calculated fields that count the number of child records, number of child records with certain conditions etc etc. 
If I add child records, the calculated fields in the parent grid update correctly. 
If I amend child records, the calculated fields in the parent grid update correctly. 
But if I delete a child record, the parent grid does not get updated (please compare screenshots 'patients1' and 'patients2').  I need to quit the application completely and re-run it. 
I have dbupdate statements in the script which normally corrects these problems.
Could you please have a look at the attached application and see if there is anything wrong.
Thanks,
Derek.

Post's attachments

Attachment icon patients.zip 701.46 kb, 382 downloads since 2017-05-22 

2 (edited by kim143 2017-05-23 04:11:14)

Re: Tablegrid not updating correctly

i tried this and i think its working fine

procedure Form1_Button7_OnAfterClick (Sender: string);
begin
     form1.tablegrid1.dbupdate;
end;

just copy and pasted your code @derek

or may be if @Dmitry can implement that dbupdate inside those buttons event to auto update grids in current running forms or form thanks for new idea @derek than we have to write less code cool. you both are genius guys. smile

Re: Tablegrid not updating correctly

Hi Kim,
Good spot.
I've always associated my 'dbupdates' with tablegrid 'changes' or 'clicks' before and never thought to try 'dbupdates' on the 'delete' afterclick.
Thanks for having a look.
.
.
Dmitry,
No need for you to have a look - the problem has been sorted.
.
Regards,
Derek.