Ok, I've got a parent/child datasource setup and bound to a datagrid with a nested datagrid within to show hierarchal info. For each row of the nested datagrid shown, I have a DropDownList with 3 options.
What I want to be able to do is click a submit button and read through each of the dropdownlists and grab the selected value.
The submit code currently looks like this:
Apologies for the noobish state, I'm new to ASP.NET.
As far as I can see, it should add the values of all the DropDownLists (drop1) to the string txtString then dump it in the textbox, but it keeps coming back blank.
Anyone got any ideas??
Cheers,
Menthos
What I want to be able to do is click a submit button and read through each of the dropdownlists and grab the selected value.
The submit code currently looks like this:
Code:
Private Sub Submit_changes(source As Object, e As EventArgs)
Dim griditem as datagriditem
dim txtString as String
DIM DropStr as String
Dim childgrid as datagrid
DIM ddl as DropDownList
childgrid = CType(DataGrid1.FindControl("datagrid2"), Datagrid)
txtString="Test"
If not(childgrid is nothing) then
For Each griditem in childgrid.Items
ddl = CType(griditem.FindControl("drop1"), Dropdownlist)
DropStr=cStr(ddl.selecteditem.value)
txtString = txtString & DropStr
Next
end if
Textbox1.text=txtString
End Sub
Apologies for the noobish state, I'm new to ASP.NET.
As far as I can see, it should add the values of all the DropDownLists (drop1) to the string txtString then dump it in the textbox, but it keeps coming back blank.
Anyone got any ideas??
Cheers,
Menthos