title: Gridview sorting with bound fields
body: <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
          AllowPaging="true" AllowSorting="true" PageSize="10" DataKeyNames="CategoryID" 
          onselectedindexchanged="GridView1_SelectedIndexChanged" 
          GridLines="Vertical" onrowediting="GridView1_RowEditing" 
          onrowcancelingedit="GridView1_RowCancelingEdit" 
          onrowupdating="GridView1_RowUpdating" onsorted="GridView1_Sorted" 
          onsorting="GridView1_Sorting"&gt;
          &lt;Columns&gt;
          &lt;asp:BoundField DataField="categoryid" HeaderText="ID" SortExpression="CategoryID" /&gt;        
          &lt;/Columns&gt;        
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Sorting does not work. What am I missing?</p>