Since you use the subGridRowExpanded as of documentation:
This event is raised when the subgrid is enabled and is executed when the user clicks on the plus icon of the grid. Can be used to put custom data in the subgrid.
pID is the unique id of the div element where we can put contents when subgrid is enabled,
id is the id of the row
If you have the id then you can $(“#mygrid”).getRowData( id ) – this retun all the values from the current clicked row and before constructing the grid you can pass what you want from this array