title: How to Display IEnumerable<IGrouping<string, Model>> with an editor template
body: <p>I have a bunch of items that I have grouped up by Header.</p>
  
  <p>I would like to display them on the page with the header text followed by the editor template for each individual item.</p>
  
  <p>I tried using nested templates as follows:</p>
  
  <p>Main Page:</p>
  
  <pre><code>@Html.EditorFor(x =&gt; x.GroupedItems, "ListofGrouping");
  </code></pre>
  
  <p>ListofGrouping Editor Template:</p>
  
  <pre><code>@model IList&lt;IGrouping&lt;string, Model&gt;&gt;
  @for(int i = 0; i &lt; Model.Count(); i++)
  {
      @Html.EditorFor(x =&gt; x[i],"IGrouping")
  }
  </code></pre>
  
  <p>IGrouping Editor Template:</p>
  
  <pre><code>@model IGrouping&lt;string, Model&gt;
  
  @Html.DisplayFor(x =&gt; x.Key)
  @Html.EditorForModel()
  </code></pre>
  
  <p>This works up till the last line. I get all the header values but the individual items are not displayed.</p>
  
  <p>If I can't get it to work this way I will just use a data grid and do the grouping there, but I figured this should be possible in MVC3.</p>