title: Dropdownlist inside a Repeater
body: <p>How to start a dropdownlist with an empty values?</p>
  
  <p>Does anyone have any suggestions as to how I can get round this
  problem, aside from creating a blank manager entry in the table, which
  is obviously not ideal!</p>
  
  <p>Many thanks!</p>
  
  <p><strong>ASPX PAGE</strong></p>
  
  <pre><code>&lt;asp:Repeater ID="GeneralRepeater" runat="server" 
   OnItemDataBound="GeneralRepeater_OnItemDataBound"&gt;
     &lt;ItemTemplate&gt;
       &lt;tr&gt;
        &lt;td&gt;
         DxPoc:
           &lt;asp:DropDownList ID="GeneralDDL" DataTextField="DiagnosisCode" 
           DataValueField="DiagnosisCode" runat="server" /&gt;
       &lt;/td&gt;
      &lt;/tr&gt;
     &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p><strong>CODE BEHIND:</strong></p>
  
  <pre><code>protected void GeneralRepeater_OnItemDataBound(object sender,
                                                 RepeaterItemEventArgs e)
  
  
       {
              if (e.Item.ItemType == ListItemType.Item ||
                  e.Item.ItemType == ListItemType.AlternatingItem)
              {
                  DropDownList myDDL = (DropDownList)e.Item.FindControl("GeneralDDL");
                  Diagnosis oDiagnosis = new Diagnosis();
                  DataView dv = new DataView(oDiagnosis.GetDiagnosis());
                  myDDL.DataSource = dv;
                  myDDL.DataTextField = "DiagnosisCode";
                  myDDL.DataValueField = "DiagnosisCode";
                  myDDL.DataBind();
  
              }
          }
  </code></pre>