title: How can I sort a gridview when using custom header text?
body: <p>I've got some custom header text that's being added on the 'RowCreated' event of my gridview:</p>
  
  <pre><code>protected void gvResults_RowCreated(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.Header)
      {
          LinkButton lbAptNo = new LinkButton();
          lbAptNo.Text = "Apartment #";
          lbAptNo.Click += new EventHandler(lbAptNo_Click);                
  
          e.Row.Cells[0].Controls.Add(lbAptNo);                    
      }
  }
  
  protected void lbAptNo_Click(object sender, EventArgs e)
  {            
      gvResults.Sort("aptno", SortDirection.Descending);            
  }
  </code></pre>
  
  <p>This code works fine in the sense that it adds the link button to the gridview and allows me to sort the data in descending order. However what I'm trying to do is detect what the current sorting is for that column, and then sort asc/desc depending on what the current value is.</p>
  
  <p>I understand I can use GridView.SortDirection to get the direction of a column but there's no way for me to specify <strong>which</strong> column. How do I do this? Is there a way I can determine the sort direction of a particular column?</p>
  
  <p>Thanks</p>