private void WriteTargetList() { //Load the Target Plan datagridview TargetPlans tPlans = new TargetPlans(); List <string> tpList = tPlans.PlanList; TargetDataGrid.Rows.Clear(); int ridx = 0; foreach (string tp in tpList) { string targetName = tp.Split('.')[0]; TargetSpecs tt = new TargetSpecs(targetName); TargetDataGrid.Rows.Add(); TargetDataGrid.Rows[ridx].Cells[0].Value = tt.TargetName; TargetDataGrid.Rows[ridx].Cells[1].Value = tt.TargetType; TargetDataGrid.Rows[ridx].Cells[2].Value = tt.RiseTime.ToString(@"hh\:mm"); TargetDataGrid.Rows[ridx].Cells[3].Value = tt.TransitTime.ToString(@"hh\:mm"); TargetDataGrid.Rows[ridx].Cells[4].Value = tt.SetTime.ToString(@"hh\:mm"); TargetDataGrid.Rows[ridx].Cells[5].Value = tt.Constellation; ridx++; } TargetDataGrid.ClearSelection(); TargetDataGrid.Update(); Show(); return; }
private void TargetDataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { //Click on an entry in the Target list will cause: //the target name to be sent to web to show target visual. string tgtName; try { tgtName = TargetDataGrid.SelectedRows[0].Cells[0].Value.ToString(); } catch (Exception ex) { TargetDataGrid.ClearSelection(); Show(); return; } FormPreview formPV = new FormPreview(tgtName); WriteTextLog("Humason current target changed to " + tgtName); return; }