title: How do I group data in an ASP.NET MVC View?
body: <p>In reporting tools like Crystal Reports, there are ways to take denormalized data and group it by a particular column in the data, creating row headings for each unique item in the specified column.</p>
  
  <p>If I have this:</p>
  
  <pre><code>Category1    Data1
  Category1    Data2
  Category1    Data3
  Category2    Data4
  Category2    Data5
  Category2    Data6
  </code></pre>
  
  <p>The reporting software will group it like this:</p>
  
  <pre><code>Category1
        Data1
        Data2
        Date3
  Category2
        Data4
        Data5
        Data6
  </code></pre>
  
  <p>Is there a way to do this in an ASP.NET MVC view, perhaps using a simple linq phrase or linq extension method with a foreach or a nested foreach?</p>