title: When does DataBinding Occur for Drop Down Lists?
body: <p>Here is my drop down list and data source.  My question is.. when is it possible to set a defaulted selected option for the drop down list, aka when have all the dropdownlists been databound and their ListItems populated? I have tried Page_PreRender, Page_PreRenderComplete, Page_Load.</p>
  
  <p>I have read over MSDN's Page Life cycle event which suggest Page_PreRender.</p>
  
  <pre><code> &lt;asp:DropDownList ID="ddlRampStandard" runat="server"
   DataSourceID="RampStandardDataSource" DataTextField="StandardName" 
   DataValueField="StandardName" RepeatDirection="Horizontal" 
   ViewStateMode="Enabled"&gt;&lt;/asp:DropDownList&gt;
  
   &lt;asp:SqlDataSource ID="RampStandardDataSource" runat="server" 
   ConnectionString="&lt;%$ ConnectionStrings:AIMP_DeleteMeConnectionString %&gt;" 
   SelectCommand="SELECT [StandardName] FROM [CR_Standard]"&gt;&lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>Here's the simple code-behind which illustrates what I'm trying to do.</p>
  
  <pre><code>Protected Sub Page_PreRenderComplete(sender As Object, e As System.EventArgs) Handles Me.Load
  ddllstSideOfStreet.Items(0).Selected = True
  End Sub
  </code></pre>
  
  <p>I'm getting an instance not created error suggesting ddllstSideOfStreet has no items. I do verify that with a breakpoint and watch that there are no items in existence in any of the previously mentioned prerender, load, prerendercomplte functions.. However when the page loads, the dropdownlist does indeed load with the expected databound information. Thoughts?</p>