title: How to populate Drop down list depending on the Selected column of a ASp.Net Gridview?
body: <p>I am fairly new I wanted to know how to populate a drop down list on select of a grid view column. I have a grid view and it has a data then i have a Drop down list I want user's to be able to click on the item in the grid view and load its ID in the Drop down list. It will make things easier for them to work with.
  Please let me know if you have any idea how to do it.
  Thanks.</p>
  
  <pre><code>&lt;asp:GridView ID="gvdata" runat="server"&gt;&lt;/asp:GridView&gt;
  </code></pre>
  
  <p>This is the Gridview. </p>
  
  <pre><code>Dataseet ds = new dataset(); gvdata.datasource = ds; gvdata.DataBind();
  </code></pre>
  
  <p>This is how i populate it. </p>
  
  <pre><code>&lt;asp:DropDownList ID="dlItemID" Width="100px" runat="server"&gt;&lt;/asp:DropDownList&gt;&lt;/td&gt;
  </code></pre>
  
  <p>This is the Drop down. </p>
  
  <pre><code>    DAL DAL= new DAL(Context, "spgetItems");
      DataSet ds = new DataSet();dlItemID.DataSource = ds; 
      DlItemID.DataTextField = "ItemID"
      DlItemId.DataValueField = "ItemID"
      DlItemID.DataBind();
  </code></pre>
  
  <p>This is how I bind the Data to it. </p>