Apply grouping to custom views list template
Turns out the $rows object has indices that don't go from 0, counting up by 1.  It keeps only indices of the items in the current group.  That makes this code work:

&lt;?php foreach ($view-&gt;style_plugin-&gt;rendered_fields as $delta =&gt; $item): ?&gt;
    &lt;?php if(isset($rows[$delta])) : ?&gt;
         ... print out whatever necessary ...
    &lt;?php endif; ?&gt;
&lt;?php endforeach; ?&gt;