title: How to bind dropdownlist in EditItemTemplate in FormView control?
body: <p>Using Visual Web Developer Express 2010 with ASP.NET 4.0.</p>
  
  <p>I have a FormView and I want to set a default value from the database. I can't get it to bind to the value in the database. My FormView looks like this:</p>
  
  <pre><code>&lt;asp:FormView 
  ID="frmOrderDetails" 
  DataSourceID="sdsFormOrderDetails" 
  runat="server" 
  DataKeyNames="orderId"&gt;
  
  &lt;EditItemTemplate&gt;
      &lt;h3&gt;Edit Order Details&lt;/h3&gt;
  
      &lt;asp:Label ID="lblStrategy" Text="Strategy:" AssociatedControlID="ddlStrategies" runat="server"  /&gt;
      &lt;asp:DropDownList SelectedValue='&lt;%# Bind("strategyId") %&gt;'
      ID="ddlStrategies" 
      runat="server" 
      DataTextField="strategy" 
      DataValueField="strategyId" 
      DataSourceID="sdsStrategies"
       /&gt;
  
      &lt;asp:LinkButton
      id="lnkUpdate"
      Text="Update Order"
      CommandName="Update"
      Runat="server" /&gt;
      |
      &lt;asp:LinkButton
      id="lnkCancel"
      Text="Cancel"
      CommandName="Cancel"
      Runat="server" /&gt;
  
  &lt;/EditItemTemplate&gt;
  &lt;/asp:FormView&gt;
  
  &lt;asp:SqlDataSource ID="sdsFormOrderDetails" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:LocalSQLServer %&gt;" 
      ProviderName="&lt;%$ ConnectionStrings:LocalSQLServer.ProviderName %&gt;"  
      SelectCommand="usp_GetOrderDetails" SelectCommandType="StoredProcedure" 
      UpdateCommand="usp_UpdateOrder" UpdateCommandType="StoredProcedure"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:ControlParameter Name="orderId" ControlID="grdOrders" PropertyName="SelectedDataKey.Value" /&gt;
      &lt;/SelectParameters&gt;
      &lt;UpdateParameters&gt;
          &lt;asp:ControlParameter Name="orderId" ControlID="grdOrders" /&gt;
      &lt;/UpdateParameters&gt;
  &lt;/asp:SqlDataSource&gt;                     
  
  &lt;asp:SqlDataSource ID="sdsStrategies" runat="server"
      ConnectionString="&lt;%$ ConnectionStrings:LocalSQLServer %&gt;" 
      ProviderName="&lt;%$ ConnectionStrings:LocalSQLServer.ProviderName %&gt;"  
      SelectCommand="usp_GetStrategiesDropDown"&gt;   
  &lt;/asp:SqlDataSource&gt;    
  </code></pre>
  
  <p>The EditItemTemplate does not even load when I click the edit button on my FormView control, but I don't get an error message either.</p>