Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Contributor
6455 Points
1187 Posts
Apr 09, 2012 12:13 PM|LINK
Get the updated values from the GridViewEventArgs.NewValues property:
protected void GridView1_RowUpdating(object sender, GridViewEditEventArgs e) { productTableAdapter pAdapter = new productTableAdapter(); int id = Convert.ToInt32(e.OldValues["id"]); string name = e.NewValues["name"].ToString(); string desc = e.NewValues["description"].ToString(); pAdapter.Update(id, name, description); GridView1.EditIndex = -1; GridView1.DataBind(); }
mm10
Contributor
6455 Points
1187 Posts
Re: TableAdapter Update GridView
Apr 09, 2012 12:13 PM|LINK
Get the updated values from the GridViewEventArgs.NewValues property:
protected void GridView1_RowUpdating(object sender, GridViewEditEventArgs e) { productTableAdapter pAdapter = new productTableAdapter(); int id = Convert.ToInt32(e.OldValues["id"]); string name = e.NewValues["name"].ToString(); string desc = e.NewValues["description"].ToString(); pAdapter.Update(id, name, description); GridView1.EditIndex = -1; GridView1.DataBind(); }