View Single Post
  #2 (permalink)  
Old August 22nd, 2007, 11:31 PM
dotnetuser dotnetuser is offline
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.