private void GridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { if (GridView.Columns[e.ColumnIndex].Name == "colID") { CustomerPayment cp = GridView.Rows[e.RowIndex].Tag as CustomerPayment; if (cp != null) { FrmCustomerPaymentDetail frm = new FrmCustomerPaymentDetail(); frm.IsAdding = false; frm.IsForView = true; frm.UpdatingItem = cp; frm.ShowDialog(); } } } }
private void GridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { if (GridView.Columns[e.ColumnIndex].Name == "colCustomerPaymentID") { string paymentID = GridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); CustomerPayment cp = (new CustomerPaymentBLL(AppSettings.Current.ConnStr)).GetByID(paymentID).QueryObject; if (cp != null) { FrmCustomerPaymentDetail frm = new FrmCustomerPaymentDetail(); frm.IsAdding = false; frm.IsForView = true; frm.UpdatingItem = cp; frm.ShowDialog(); } } } }