label1.text为编辑前的值.
DropDownList1.Items.FindByText(label1.text).Selected =true

解决方案 »

  1.   

    DropDownList1.Items.Add(new ListItem(myReader["SendName"].ToString(),myReader["unitType"].ToString ()));strSQL="SELECT "+(string)Application["sqldlDataGrid1"]+" from "+strViewName +" where (日期<='"+strTextBox2+" 'and 日期>='"+strTextBox1+"')  "+tempStr;//and UI =" +DropDownList2.SelectedItem .Value  ;


    SqlDataAdapter myAdapter=new SqlDataAdapter(strSQL,myConnection);
    DataSet myDataSet=new DataSet();
    myAdapter.Fill(myDataSet,"strDropDownList2");
    DataGrid1.DataSource=myDataSet.Tables["strDropDownList2"].DefaultView;
    DataGrid1.DataBind ();
      

  2.   

    DATAGRID绑的是DATASET吧?你把它绑那个DATASET得到,然后绑到DropDownList上啊。DepaList是一个DropDownList DataSet Result = (DataSet) Sacc.QueryResult; this.DepaList.DataTextField = "DEPARTMENT_NAME";
    this.DepaList.DataValueField = "DEPARTMENT_ID"; this.DepaList.DataSource = Result.Tables[0].DefaultView; this.DepaList.DataBind();