수정할려는 부분이 DropDownList일때 기본적으로 선택하는방법

  protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        try
        {

           int index = GridView1.EditIndex;
           GridViewRow row = GridView1.Rows[index];
            Control ddl = ((GridView)sender).Rows[e.RowIndex].FindControl("DropDownList1");
            if (ddl != null) {

                e.NewValues["big_cate"] =((DropDownList) ddl).SelectedValue;
            }         

        }
        catch (System.Exception es) {

            Response.Write(es.ToString());
        }  

    }

+ Recent posts