protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = GridView1.SelectedRow; int invoiceid = int.Parse(row.Cells[0].Text); TextBox tb = (TextBox)row.FindControl("TextBox1"); string paymentStatus = tb.Text; DALinvoice invoice = new DALinvoice(); invoice.updatePaymentStatus(invoiceid, paymentStatus); }
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = GridView1.Rows[e.RowIndex]; int invoiceid = int.Parse(row.Cells[0].Text); DropDownList dd = (DropDownList)row.FindControl("DropDownList1"); string paymentStatus = dd.SelectedValue; DALinvoice invoice = new DALinvoice(); invoice.updatePaymentStatus(invoiceid, paymentStatus); GridView1.EditIndex = -1; bindGridView(); }