title: GridView ASP.NET Sorting
body: <p>I have an ASP.NET GridView that just won't sort!  I'm sure that I am missing something pretty obvious.</p>
  
  <p><strong>Page.aspx</strong></p>
  
  <pre><code>&lt;asp:GridView ID="TimeAwayGridView" runat="server" AutoGenerateSelectButton="False"
      AutoGenerateEditButton="False" AutoGenerateDeleteButton="False" AllowPaging="False"
      AllowSorting="True" CssClass="gridview" OnSorting="TimeAwayGridView_Sorting"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /&gt;
          &lt;asp:BoundField DataField="Hours" HeaderText="Hours" SortExpression="Hours" /&gt;
      &lt;/Columns&gt;
      &lt;EmptyDataTemplate&gt;
          There are currently no items in this table.
      &lt;/EmptyDataTemplate&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p><strong>Page.aspx.cs</strong></p>
  
  <pre><code>protected void TimeAwayGridView_Sorting(object sender, GridViewSortEventArgs e)
  {
  
  }
  </code></pre>