In case of helping others. This is what I tried to accomplish.
Action code
var groupedManuals = manuals.GroupBy(c => c.Series);
return View(groupedManuals);
View
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<IGrouping<string, ProductManualModel>>>" %>
<% foreach (var item in Model)
{ %>
<div class="manual-category">
<h5>
<%= Html.Encode(item.Key) %> Series</h5>
<ul>
<% foreach (var m in item)
{ %>
<li><a href="<%=Url.ManualLink(m.Id) %>" class="model-manuals">
<%= m.Id %></a> </li>
<% } %>
</ul>
</div>
IGrouping is a list of lists, so to speak. When the "Key" is a grouped property in the source list.
jason source
share