How to get selected value of datagrid dropdownlist
hi
i have drop down list in mydatagrid. and i loaded my database values in that and if i select any value from that dropdownlist it has to be shown in my textbox wthich is some where in my page.i want to do in servevr side.
i am using c# asp.net
so tell me the coding.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
ramakrishna2 pointsPosted Jun 30, 2006, 3:11 AM EDT
it will return the selectedindex for u r selection
this is the syntax:
formname.comboboxname.selectedindex
take that value and use that index based on u r req.
Former memberPosted Jun 30, 2006, 4:31 AM EDT
----Code--------
DropDownList DDLCtrl=(DropDownList)DataGrid1.Item[index].Cells[index].Controls[index];
//For e.g DropDownList DDLCtrl=(DropDownList)DataGrid1.Item[0].Cells[1].Controls[1];
Response.Write(DDLCtrl.SelectedItem.Text);
hope solved ur problem