title: DropDownList SelectedIndexChanged event not firing within GridView HeaderTemplate
body: <p>I am working on a job board website and specifically the job search page at the moment. I am returning the jobs found into a <code>DataBound</code> <code>GridView</code> (namely <code>gvwJobs</code>), and within the <code>HeaderTemplate</code> I have a <code>DropDownList</code> named <code>ddlSortDirection</code> which specifies the direction in which the sorting is performed:</p>
  
  <pre><code>&lt;asp:DropDownList runat="server" ID="ddlSortDirection" AutoPostBack="true" OnSelectedIndexChanged="ddlSortDirection_SelectedIndexChanged"&gt;
  
      &lt;asp:ListItem Value="DESC"&gt;DOWN&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Value="ASC"&gt;UP&lt;/asp:ListItem&gt;
  
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>As you can see, I have ensured that <code>AutoPostBack</code> is on. I have also created a custom event handler on the <code>GridView</code>'s <code>DataBound</code> event as so:</p>
  
  <pre><code>Protected Sub gvwJobs_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvwJobs.RowDataBound
  
      If e.Row.RowType = DataControlRowType.Header Then
  
                  ddlSortDirection.AutoPostBack = True
                  AddHandler ddlSortDirection.SelectedIndexChanged, AddressOf ddlSortDirection_SelectedIndexChanged
  
  
       End If
  
  End Sub
  </code></pre>
  
  <p>I am finding that the <code>ddlSortDirection_SelectedIndexChanged</code> SubProcedure is not called when the selection is changed in <code>ddlSortDirection</code>. I can see that a <code>PostBack</code> occurs, but the method is definitely not called. What I have tried doing is creating a similar <code>DropDownList</code> outside of the <code>GridView</code> and that successfully triggered the <code>SelectedIndexChanged</code> event without even having a custom event handler!</p>
  
  <p>Please could you help me to achieve my goal of having a <code>DropDownList</code> firing the <code>SelectedIndexChanged</code> event when within a <code>HeaderTemplate</code> of a <code>GridView</code>?</p>