getting list of records in a subgrid using webapi or fetchxml
<p>I want to get list of all records that are in a subgrid in a form</p>

<p>Is there a way to get it using some api call or using javascript?
The below code will fetch the rows if the subgrid is available in the form but
I don't want to have the subgrid in the form where I am going to fetch these records</p>

<pre><code>var selectedRows = Xrm.Page.getControl("Contacts").getGrid().getSelectedRows();
var rows = Xrm.Page.getControl("Contacts").getGrid().getRows();
</code></pre>

<p>For example, assume that I have a medicalCase entity form, where I am having patients subgrid. I want to get the list of records in the patients subgrid using webapi in some other entity form</p>