title: Dropdown list and gridview row-index/selectedvalue issue
body: <p>I have a gridview with a dropdown list that was created programmatcially. I want to have <br>access to the selected value and to that row's Id.   I have the dropdownlist created in <strong><em>Gridview_RowDataBound</em></strong> and I am able to use the text in the cell but my addHandler is never fired. Where do I give it the Add handler. I believe I can assign it the addhandler in RowCreated but how would I be able to set up the add handler if the button is created in rowdatabound?</p>
  
  <pre><code>Dim deptvalue As String
      Dim i As Integer = 0
  
      Dim ddlmgr As New DropDownList
      ddlmgr.AutoPostBack = True
      AddHandler ddlmgr.SelectedIndexChanged, AddressOf ddlmgr_SelectedIndexChanged
      ddlmgr.Items.Clear()
      ddlmgr.Items.Insert(0, "--Select a Manager--")
      ddlmgr.AppendDataBoundItems = True
      ddlmgr.DataTextField = "Name"
      ddlmgr.DataValueField = "number"
      ddlmgr.DataSource = SqlDataSource2
      ddlmgr.DataBind()
  
      deptvalue = e.Row.Cells(0).Text
      ddlmgr.Attributes.Add("onchange", "setDepart('" &amp; deptvalue &amp; "')")
  
      If e.Row.RowType &lt;&gt; DataControlRowType.Pager And e.Row.RowType &lt;&gt; DataControlRowType.Header And e.Row.RowType &lt;&gt; DataControlRowType.Footer Then
          e.Row.Cells(2).Controls.Add(ddlmgr)
      End If
  
      If e.Row.RowType &lt;&gt; DataControlRowType.Pager And e.Row.RowType &lt;&gt; DataControlRowType.Footer Then
          e.Row.Cells(0).Style.Add("display", "none")
      End If
  </code></pre>
  
  <p>It fits best in Rowdata bound because my dropdownlist items don't duplicate but I need to be able to use the addhandler I created.</p>