Iโm not quite sure that this is what you need, let me know and I will try to help.
This will not work directly for you, but hopefully you can correctly point to it. I am currently using a custom view model to store this data, and I am actually thinking about getting away from it, as my system is becoming very complex, but it can help you.
I can explain what it means if I need you, (I was noob just a year ago!)
, , .
<% foreach (var group in Model.GroupBy(item => item.categoryId)) Gives you the inital sort
{ %>
<% foreach (var item in group.Take(1))
{ //Category %>
<%=Html.Encode(item.CategoryName) %>
<% } %>
<% foreach (var item in group)
{ //Indervidual races%>
<%=Html.Encode(item.raceResult) %>
<% } %>
<% foreach (var item in group.Take(1))
{ %>
<% } %>
<% } %>