private void buttonOk_Click(object sender, EventArgs e) { IsTestSelected = false; try { if (dgvTests.SelectedRows != null && dgvTests.SelectedRows.Count > 0) { DataGridViewRow row = dgvTests.SelectedRows[0]; //string date = DataConverter.UTCDateFormat(row.Cells["DateUTC"].Value.ToString()); string date = row.Cells["DateUTC"].Value.ToString(); string patient = row.Cells["Patient"].Value.ToString(); string ttype = row.Cells["Test"].Value.ToString(); TestType = (ttype == "reading") ? TestType.reading : TestType.pursuit; string user_id = row.Cells["PatientID"].Value.ToString(); TestData = DataBaseWorker.LoadTestDataByDateAndID(date, user_id); EyeTrackerData = DataBaseWorker.LoadEyeTrackerData(date, user_id); if (TestType == TestType.reading) { FixData = DataBaseWorker.LoadReadingData(date, user_id); } else { PursuitData = DataBaseWorker.LoadPursuitData(date, user_id); } IsTestSelected = true; } else { IsTestSelected = false; } } catch (Exception ex) { ErrorLog.ErrorLog.toErrorFile(ex.GetBaseException().ToString());; } }