I looked at code in database demos - Master Detail Expander. It is working very good, but it is only master-detail relation.
I tried to expand it for third level, but I couldn't do it.
So I don't know, how to implement next level of details (subdetails) - as shown in the picture:

I would be very grateful if someone can write me ('step by step' or by showing of code/link to an example) how to obtain master-detail-subdetail effect in a TeeGrid. (How deep can we nest data?)
Tkank you in advance for any help, tips, hints...
Greetings for all,
Pawel
PS. I use Delphi (11/12) and Lazarus (2.2.6 and higher), so if this funcionality is not available for some IDE, please write me also.
(sorry for my english)