void dgPaymentFromCustomer_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgPaymentFromCustomer.Columns[e.ColumnIndex].Name == "Receive Payment") { if (dgPaymentFromCustomer.Rows[e.RowIndex].Cells["Id"].Value.ToString() != "") { //MessageBox.Show("Supplier Invoice Id:" + dgPaymentToSupplier.Rows[e.RowIndex].Cells["Id"].Value); CustomerMakePaymentForm customerMakePaymentForm = new CustomerMakePaymentForm(); customerMakePaymentForm.setId(int.Parse(dgPaymentFromCustomer.Rows[e.RowIndex].Cells["Id"].Value.ToString()), APCContext); customerMakePaymentForm.Show(); } } }