In my code i am not able to get the new value from thre textbox which got created when we click the edit button. IT is taking the value which is retried from the database. please help...
Code:
protected void qltyGrid_EditCommand(object source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
qltyGrid.EditItemIndex = e.Item.ItemIndex;
BindData();
}
protected void qltyGrid_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string cName = ((TextBox)e.Item.Cells[1].Controls[0]).Text;
ShowMsg(cName);
SqlCommand com = new SqlCommand("update QualityMasters set QltyName='" + cName + "' where QltyId='" + 2 + "';", con);
con.Open();
com.ExecuteNonQuery();
con.Close();
qltyGrid.EditItemIndex = -1;
BindData();
}
Comment