title: Getting pre-selected Text in dropdown in EditItemTemplate gridview
body: <p>I am not able to get preselected text in dropdown in edit template. Please see my code:</p>
  
  <pre><code>&lt;EditItemTemplate&gt;
     &lt;asp:DropDownList ID="droplist" runat="server"&gt;
     &lt;/asp:DropDownList&gt;
  &lt;/EditItemTemplate&gt;
  </code></pre>
  
  <p>c# code</p>
  
  <pre><code>protected void gvDetails_RowDataBound(object sender, GridViewRowEventArgs e)
  {
          if (e.Row.RowType == DataControlRowType.DataRow)
          {
              if ((e.Row.RowState &amp; DataControlRowState.Edit) &gt; 0)
              {
                  DropDownList droplist = (DropDownList)e.Row.FindControl("droplist");
                  droplist.DataSource = EquipmentBLL.getunitdrop();
                  droplist.DataTextField = "UnitName";
                  droplist.DataValueField = "UnitID";
                  droplist.DataBind();
                  droplist.Items.Insert(0, new ListItem(" Select Unit ", "0"));
                  //droplist.Items.FindByText(unittypetext).Selected = true;
              }
          }
  }
  </code></pre>
  
  <p>Can someone tell me what I should do to get preselected dropdown?</p>
  
  <p>regards
  Hussain</p>