protected void GridView1_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { //int city_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString()); GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex]; Label lbl_id = (Label)row.FindControl("lbl_eclg_id"); DropDownList drp_city = (DropDownList)row.FindControl("drp_city_name"); TextBox txt_code = (TextBox)row.FindControl("txt_clg_code"); TextBox txt_clg = (TextBox)row.FindControl("txt_clg_name"); GridView1.EditIndex = -1; int i = bl.update_clg(Convert.ToInt32(lbl_id.Text), Convert.ToInt32(drp_city.SelectedValue), Convert.ToInt32(txt_code.Text), txt_clg.Text); databind_clg(); }