title: ASP.NET - GridView - How to programmatically add and read new controls to the cell?
body: <p>Here is the setup:
  I programmatically populate my gridview using LINQ to SQL query. Then I enter the edit mode and want to replace some standard TextBox controls with DropDownLists like this:</p>
  
  <p>'excerpt from GridView1_RowEditing</p>
  
  <pre><code>    Dim ddlist1 As New DropDownList
      Dim res1 = From items1 In mydb.Items
               Select items1.Col10
  
      ddlist1.DataSource = res1
      ddlist1.DataBind()
  
      GridView1.Rows.Item(0).Cells(1).Controls.Add(ddlist1)
  </code></pre>
  
  <p>At this moment I have my gridview showing standard textbox control and new DDList control (in the Column 1).
  The problem is -- I cant read the value from DDList in the RowUpdating method. It seems like DDList control is not in the GridView1.Rows.Item(0).Cells(1).Controls collection.
  RowUpdating method sees only standard TextBox control and can read it's value.
  Any suggestions are welcome. I just don't understand something here :(</p>