Hi
Hope this helps u
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddl = (DropDownList)sender;
string selectedStatus = ddl.SelectedValue.ToString();
}
or can get the value as below in any event, say for example in btnSave_Click
foreach (DetailsViewRow row in DetailsView1)
{
DropDownList ddl=(DropDownList)row.FindControl("DropDownList1") ;
string ddlItem = ddl.SelectedItem.Text;
}
Store the value of ddlItem in database.
Regards,
Sripa.
|