You could find the selected rows in the master Grid via their CSS classes - k-master-row and k-state-selected.
grid = $(
selected = grid.tbody.find(
Then you could check if the next row for each of them has the k-detail-row
CSS class. This will mean that the corresponding detail row has been expanded at least once.
nextRow = $(
childGrid = nextRow.find(
//access child Grid data