protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e) { int iStock_id, iQunatity; iStock_id = Convert.ToInt32(e.Values["STOCK_ID"]); iQunatity = Convert.ToInt32(e.Values["QUANTITY"]); int index = Convert.ToInt32(e.RowIndex); DataTable dt = ViewState["SALE_TRANSACTION_TABLE"] as DataTable; dt.Rows[index].Delete(); ViewState["SALE_TRANSACTION_TABLE"] = dt; SaleStockTrans.DataSource = ViewState["SALE_TRANSACTION_TABLE"] as DataTable; SaleStockTrans.DataBind(); stock.UpdateStockQuantityAfterDelete(iQunatity, iStock_id); }