title: allow sorting by column gridview
body: <p>I am writing project which gets data from Data Acess Layer and show it in GridView.
  The problem is to allow sorting by column. When I click on head of columnt following occurs following error:</p>
  
  <p>Exception Details: System.Web.HttpException: GridView 'GridView1' Trigger Events Sorting, which has not been processed.</p>
  
  <p>Here the .cs code:</p>
  
  <pre><code>public partial class Default: System.Web.UI.Page
      {
          EmployeesTableAdapter eta = new EmployeesTableAdapter();
  
          protected void Page_Load(object sender, EventArgs e)
          {
              if (!IsPostBack)
              {
                  GridView1.DataSource = eta.GetData();
                  GridView1.DataBind();
              }
          }
      }
  </code></pre>
  
  <p>Here the .aspx code(only gridview):</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
          AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" 
          AutoGenerateColumns="False"&gt;
          &lt;AlternatingRowStyle BackColor="White" /&gt;
  
  &lt;Columns&gt;
              &lt;asp:TemplateField HeaderText="Select"&gt;
                  &lt;ItemTemplate&gt;                
                      &lt;asp:CheckBox ID="CheckBox1" runat="server"&gt;
                  &lt;/asp:CheckBox&gt;
                  &lt;/ItemTemplate&gt;                
              &lt;/asp:TemplateField&gt;  
  
              &lt;asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" /&gt;
              &lt;asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" /&gt;
              &lt;asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" /&gt;
  
              &lt;asp:TemplateField HeaderText="View"&gt;
                  &lt;ItemTemplate&gt;                
                      &lt;asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/view.png"/&gt;
                  &lt;/ItemTemplate&gt;                
              &lt;/asp:TemplateField&gt; 
  
              &lt;asp:TemplateField HeaderText="Edit"&gt;
                  &lt;ItemTemplate&gt;                
                      &lt;asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="images/edit.png"/&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt; 
  
          &lt;/Columns&gt;
          &lt;EditRowStyle BackColor="#2461BF" /&gt;
          &lt;FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
          &lt;HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
          &lt;PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /&gt;
          &lt;RowStyle BackColor="#EFF3FB" /&gt;
          &lt;SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /&gt;
          &lt;SortedAscendingCellStyle BackColor="#F5F7FB" /&gt;
          &lt;SortedAscendingHeaderStyle BackColor="#6D95E1" /&gt;
          &lt;SortedDescendingCellStyle BackColor="#E9EBEF" /&gt;
          &lt;SortedDescendingHeaderStyle BackColor="#4870BE" /&gt;
         &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Does someony know how to allow sorting by columns?</p>