private void dgvBatchTokens_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { var batch = dgvBatchTokens.Rows[e.RowIndex].DataBoundItem as Batch; if (batch != null) { var detailsForm = new BatchDetailsReport(); detailsForm.StartDailyNumberVal = batch.StartDailyNumber; detailsForm.LastDailyNumberVal = batch.LastDailyNumber; detailsForm.ServiceIDVal = batch.ServiceId; detailsForm.BatchIdVal = batch.Id; detailsForm.BatchTimeVal = batch.CreatedOn; detailsForm.Show(this); } } }