怎么在后台获得GridView里下拉列表控件名 

解决方案 »

  1.   

                for (int i = 0; i < GridView1.Rows.Count;i++ )
                {
                    ((DropDownList)GridView1.Rows[i].FindControl("ddlname")).SelectedItem.Text;
                }
      

  2.   

    是拿值么?
    int ddlGradeId = Convert.ToInt32((GridView1.Rows[GridView1.EditIndex].FindControl("ddlGradeId") as DropDownList).Text);
    这样可以获得下拉列表控件的文本
      

  3.   

    看你在哪个事件里了编辑的时候获取 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string value = (this.GridView1.Rows[e.RowIndex].FindControl("DropDownList1") as DropDownList).SelectedValue;
        }(this.GridView1.Rows[e.RowIndex].FindControl("DropDownList的ID") as DropDownList).SelectedValue;