Let’s start with a DataGrid that looks like the following
If we wanted to retrieve the value that a user selects from the drop down list control shown in Column 4 into a value. We would use the following code.
' Gets the value the dropdown control in the fourth columnDim drop As DropDownListdrop = CType(e.Item.Cells(4).Controls(1), DropDownList)currentquantity = drop.SelectedValue
The above code is creating a local copy of the control using a cast. Once the local copy is created you can access the standard controls defined for the control.