How to we actually get the value of the selected item in a dropdownlist.The dropdownlist is in an item template of a griw view.
The following code does gets the value but its always theh first item in the dropdownlist:
protected void viewfiles(object sender, GridViewCommandEventArgs e)
if (e.CommandName == "savefiles")
int Index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = gvunclassified.Rows[Index];
DropDownList Offices = row.FindControl("DDept") as DropDownList;
String deparmentname = (Offices is DropDownList) ? Offices.SelectedValue : null;
Try setting autopostback = true in gridview
I had also same problem.
then i have put a hidden field in the page and change the value in java script of obchnage event of combo box
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)