title: Retrieve value from DropDownList in nested GridView on RowCommand
body: <p>I have a nested GridView(<code>GvMP_Summary_Items</code>). Each row contains a DropDownList. The DropDownList is bounded on the RowDataBound event of the nested GridView. </p>
  
  <p>Each row also contains 1 Button. Upon pressing this button on the RowCommand event, I would like to find the current selected value of the DropDownList so I can use it further on in the code.</p>
  
  <p>The code I have will only get the default value of the DropDownList on each row, which is currently set at <code>0</code> for each row.</p>
  
  <p>Below is the RowCommand Event:</p>
  
  <pre><code>Protected Sub GvMP_Summary_Items_RowCommand(sender As Object, e As GridViewCommandEventArgs)
  
    Dim lb As ImageButton = CType(e.CommandSource, ImageButton)
    Dim gvRow As GridViewRow = lb.BindingContainer //Getting current row to get index       
  
    Dim GvMP_Summary_Items As GridView = CType(gvRow.FindControl("GvMP_Summary_Items"), GridView)
  
    Dim intMPItem_Qty As Integer = CType(gvRow.FindControl("cboMPItem_Qty"), DropDownList).SelectedValue
    Dim strMPItem_Qty As String = CType(gvRow.FindControl("txtMPItem_Qty"), TextBox).Text
  
  End Sub
  </code></pre>
  
  <p>I have even included a TextBox in the GridView row which default value is empty <code>""</code>. Although on the row if something is entered the on RowCommand event brings back the value with a comma(,) in front of it. </p>
  
  <p>This proves that I am picking up the correct row and can retrieve a value from a TextBox but not a DropDownList. </p>
  
  <p>Is there something I am missing? Why can I return a value entered in a TextBox but not the selected value of a DropDownList? Also why the comma(,) in front of the TextBox value?</p>
  
  <p><strong>Note:</strong> In above case code has been written using VB so answers in VB over C# but I can accept both.</p>