Child records are shown in the subgrid and they will always have the ID of parent in a field. When we create a parent child relationship a field is automatecally added to child record which hold the parent ID. Like parentaccountid on contact record. You
will have to find that field in the child entity and show on the form. Then you can get it's id.
Regards Faisal