private void Edit_Click() { if (gridMain.GetSelectedIndex() == -1) { MsgBox.Show(this, "Please pick an account first."); return; } int acctNum = PIn.PInt(table.Rows[gridMain.GetSelectedIndex()]["AccountNum"].ToString()); if (acctNum == 0) { MsgBox.Show(this, "This account is generated automatically, and cannot be edited."); return; } Account acct = Accounts.GetAccount(acctNum); FormAccountEdit FormA = new FormAccountEdit(acct); FormA.ShowDialog(); FillGrid(); for (int i = 0; i < table.Rows.Count; i++) { if (table.Rows[i]["AccountNum"].ToString() == acctNum.ToString()) { gridMain.SetSelected(i, true); } } }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { SelectedPatNum = PIn.PInt(table.Rows[e.Row]["PatNum"].ToString()); Recall[] recalls = Recalls.GetList(new int[] { SelectedPatNum }); FormRecallListEdit FormRE = new FormRecallListEdit(recalls[0]); FormRE.ShowDialog(); if (FormRE.PinClicked) { PinClicked = true; AptSelected = FormRE.AptSelected; DialogResult = DialogResult.OK; return; } else { FillMain(); } for (int i = 0; i < gridMain.Rows.Count; i++) { if (PIn.PInt(table.Rows[i]["PatNum"].ToString()) == SelectedPatNum) { gridMain.SetSelected(i, true); } } SetFamilyColors(); }
private void FormInsFilingCodes_Load(object sender, EventArgs e) { if (IsSelectionMode) { butClose.Text = Lan.g(this, "Cancel"); } else { butOK.Visible = false; butNone.Visible = false; } _listInsFilingCodes = InsFilingCodes.GetDeepCopy(); //synch the itemorders just in case for (int i = 0; i < _listInsFilingCodes.Count; i++) { if (_listInsFilingCodes[i].ItemOrder != i) { _listInsFilingCodes[i].ItemOrder = i; InsFilingCodes.Update(_listInsFilingCodes[i]); changed = true; } } FillGrid(); if (SelectedInsFilingCodeNum != 0) { for (int i = 0; i < _listInsFilingCodes.Count; i++) { if (_listInsFilingCodes[i].InsFilingCodeNum == SelectedInsFilingCodeNum) { gridMain.SetSelected(i, true); break; } } } }
private void butUp_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select an item in the grid first."); return; } int[] selected = new int[gridMain.SelectedIndices.Length]; for (int i = 0; i < gridMain.SelectedIndices.Length; i++) { selected[i] = gridMain.SelectedIndices[i]; } if (selected[0] == 0) { return; } for (int i = 0; i < selected.Length; i++) { ListShowing.Reverse(selected[i] - 1, 2); } FillGrids(); for (int i = 0; i < selected.Length; i++) { gridMain.SetSelected(selected[i] - 1, true); } changed = true; }
private void butUp_Click(object sender, System.EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "You must first select a row."); return; } int selected = gridMain.GetSelectedIndex(); if (selected == 0) { return; //already at the top } Operatory selectedOp = (Operatory)gridMain.Rows[selected].Tag; Operatory aboveSelectedOp = (Operatory)gridMain.Rows[selected - 1].Tag; string strErr; if (!CanReorderOps(selectedOp, aboveSelectedOp, out strErr)) { MessageBox.Show(strErr); //already translated return; } int selectedItemOrder = selectedOp.ItemOrder; //move selected item up selectedOp.ItemOrder = aboveSelectedOp.ItemOrder; //move the one above it down aboveSelectedOp.ItemOrder = selectedItemOrder; //Swap positions _listOps = _listOps.OrderBy(x => x.ItemOrder).ToList(); //FillGrid(); //We don't fill grid anymore because it takes too long and we dont need to pull any new data into the DB. SwapGridMainLocations(selected, selected - 1); gridMain.SetSelected(selected - 1, true); }
private void butUp_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { MsgBox.Show(this, "Please select an item in the grid first."); return; } if (gridMain.SelectedIndices[0] == 0) { return; } int[] arrayIndicies = new int[gridMain.SelectedIndices.Length]; for (int i = 0; i < gridMain.SelectedIndices.Length; i++) { arrayIndicies[i] = gridMain.SelectedIndices[i]; } OrthoChartTabFields orthoChartTabFields = GetSelectedFields(); for (int i = 0; i < arrayIndicies.Length; i++) { orthoChartTabFields.ListDisplayFields.Reverse(arrayIndicies[i] - 1, 2); } FillGrids(); for (int i = 0; i < arrayIndicies.Length; i++) { gridMain.SetSelected(arrayIndicies[i] - 1, true); } changed = true; }
private void grid_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { SelectedPatNum = PIn.PInt(table.Rows[e.Row]["PatNum"].ToString()); Cursor = Cursors.WaitCursor; int selectedApt = PIn.PInt(table.Rows[e.Row]["AptNum"].ToString()); //Appointment apt=Appointments.GetOneApt(selectedApt); FormApptEdit FormA = new FormApptEdit(selectedApt); FormA.PinIsVisible = true; FormA.ShowDialog(); if (FormA.PinClicked) { PinClicked = true; AptSelected = selectedApt; DialogResult = DialogResult.OK; return; } else { FillMain(); } for (int i = 0; i < table.Rows.Count; i++) { if (PIn.PInt(table.Rows[i]["AptNum"].ToString()) == selectedApt) { grid.SetSelected(i, true); } } SetFamilyColors(); Cursor = Cursors.Default; }
private void FormBilling_Load(object sender, System.EventArgs e) { //contrAccount1.checkShowAll.Checked=false; //textDate.Text=Ledgers.GetClosestFirst(DateTime.Today).ToShortDateString(); //Patients.GetAgingList(); FillTable(); gridBill.SetSelected(true); }
private void FormClaimPayEdit_Load(object sender, System.EventArgs e) { //ClaimPayment created before opening this form if (IsNew) { if (!Security.IsAuthorized(Permissions.InsPayCreate)) //date not checked here { DialogResult = DialogResult.Cancel; //causes claimPayment to be deleted. return; } } else { if (!Security.IsAuthorized(Permissions.InsPayEdit, ClaimPaymentCur.CheckDate)) { butOK.Enabled = false; butDelete.Enabled = false; } } if (IsNew) { checkShowUn.Checked = true; } if (!PrefC.HasClinicsEnabled) { comboClinic.Visible = false; labelClinic.Visible = false; } comboClinic.Items.Clear(); comboClinic.Items.Add(Lan.g(this, "None")); comboClinic.SelectedIndex = 0; _listClinics = Clinics.GetDeepCopy(true); for (int i = 0; i < _listClinics.Count; i++) { comboClinic.Items.Add(_listClinics[i].Abbr); if (_listClinics[i].ClinicNum == ClaimPaymentCur.ClinicNum) { comboClinic.SelectedIndex = i + 1; } } textDate.Text = ClaimPaymentCur.CheckDate.ToShortDateString(); textCheckNum.Text = ClaimPaymentCur.CheckNum; textBankBranch.Text = ClaimPaymentCur.BankBranch; textCarrierName.Text = ClaimPaymentCur.CarrierName; textNote.Text = ClaimPaymentCur.Note; FillGrid(); if (IsNew) { gridMain.SetSelected(true); splitTot = 0; for (int i = 0; i < gridMain.SelectedIndices.Length; i++) { splitTot += (decimal)splits[gridMain.SelectedIndices[i]].InsPayAmt; } textAmount.Text = splitTot.ToString("F"); } }
private void butSearch_Click(object sender, EventArgs e) { gridMain.SetSelected(false); try{ FillGrid(); } catch { MsgBox.Show(this, "This feature won't work until you install Microsoft dotNET 3.5."); } }
private void Reconcile_Click() { int selectedRow = gridMain.GetSelectedIndex(); int scrollValue = gridMain.ScrollValue; FormReconciles FormR = new FormReconciles(AccountCur.AccountNum); FormR.ShowDialog(); FillGrid(); gridMain.SetSelected(selectedRow, true); gridMain.ScrollValue = scrollValue; }
private void FormProviderSelect_Load(object sender, System.EventArgs e) { SetFilterControlsAndAction(() => FillGrid(), (int)TimeSpan.FromSeconds(0.5).TotalMilliseconds, textFName, textLName, textProvNum); checkShowAll.Visible = IsShowAllAvailable; if (PrefC.GetBool(PrefName.EasyHideDentalSchools)) { groupDentalSchools.Visible = false; } else if (IsStudentPicker) { this.Text = "Student Picker"; gridMain.Title = "Students"; _schoolClasses = SchoolClasses.GetDeepCopy(); for (int i = 0; i < _schoolClasses.Count; i++) { comboClass.Items.Add(_schoolClasses[i].GradYear + " " + _schoolClasses[i].Descript); } if (comboClass.Items.Count > 0) { comboClass.SelectedIndex = 0; } } else { comboClass.Visible = false; labelClass.Visible = false; } FillGrid(); if (_listProviders != null) { for (int i = 0; i < _listProviders.Count; i++) { if (_listProviders[i].ProvNum == SelectedProvNum) { gridMain.SetSelected(i, true); break; } } } else if (SelectedProvNum != 0) { gridMain.SetSelected(Providers.GetIndex(SelectedProvNum), true); } butSelectNone.Visible = IsNoneAvailable; if (IsNoneAvailable) { //Default value for the selected provider when none is an option is always -1 SelectedProvNum = -1; } }
private void FormClaimPayTotal_Shown(object sender, EventArgs e) { InsPlan plan = InsPlans.GetPlan(ClaimProcsToEdit[0].PlanNum, PlanList); if (plan.AllowedFeeSched != 0) //allowed fee sched { gridMain.SetSelected(new Point(7, 0)); //Allowed, first row. } else { gridMain.SetSelected(new Point(8, 0)); //InsPay, first row. } }
private void FormReferralsPatient_Load(object sender, EventArgs e) { if (IsSelectionMode) { gridMain.SelectionMode = GridSelectionMode.One; butClose.Text = "Cancel"; butOK.Visible = true; } if (ProcNum != 0) { Text = Lan.g(this, "Referrals"); butAddFrom.Visible = false; butAddCustom.Visible = false; } else //all for patient { checkShowAll.Visible = false; //we will always show all } FillGrid(); if (RefAttachList.Count > 0 && !IsSelectionMode) { gridMain.SetSelected(0, true); } Plugins.HookAddCode(this, "FormReferralsPatient.Load_end"); }
private void FillGrid() { try{ TerminalList = TerminalActives.Refresh(); } catch { //SocketException if db connection gets lost. return; } int selected = gridMain.GetSelectedIndex(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableTerminals", "Computer Name"), 150); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableTerminals", "Status"), 100); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableTerminals", "Patient"), 150); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < TerminalList.Length; i++) { row = new ODGridRow(); row.Cells.Add(TerminalList[i].ComputerName); row.Cells.Add(Lan.g("TerminalStatusEnum", TerminalList[i].TerminalStatus.ToString())); /*switch (TerminalList[i].TerminalStatus){ * case TerminalStatusEnum.Standby: * row.Cells.Add(""); * break; * }*/ if (TerminalList[i].PatNum == 0) { row.Cells.Add(""); } else { row.Cells.Add(Patients.GetLim(TerminalList[i].PatNum).GetNameLF()); } gridMain.Rows.Add(row); } gridMain.EndUpdate(); gridMain.SetSelected(selected, true); if (gridMain.GetSelectedIndex() == -1 && gridMain.Rows.Count > 0) { gridMain.SetSelected(0, true); } }
private void FillGrid() { if (comboClass.SelectedIndex == -1 || comboCourse.SelectedIndex == -1) { return; } int selected = 0; if (gridMain.GetSelectedIndex() != -1) { selected = PIn.PInt(table.Rows[gridMain.GetSelectedIndex()]["ReqNeededNum"].ToString()); } int scroll = gridMain.ScrollValue; int schoolClass = SchoolClasses.List[comboClass.SelectedIndex].SchoolClassNum; int schoolCourse = SchoolCourses.List[comboCourse.SelectedIndex].SchoolCourseNum; table = ReqNeededs.Refresh(schoolClass, schoolCourse); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col; //col=new ODGridColumn(Lan.g("TableRequirementsNeeded","Class"),100); //gridMain.Columns.Add(col); //col=new ODGridColumn(Lan.g("TableRequirementsNeeded","Course"),100); //gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableRequirementsNeeded", "Description"), 200); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < table.Rows.Count; i++) { row = new ODGridRow(); //row.Cells.Add(SchoolClasses.GetDescript(PIn.PInt(table.Rows[i]["SchoolClassNum"].ToString()))); //row.Cells.Add(SchoolCourses.GetCourseID(PIn.PInt(table.Rows[i]["SchoolCourseNum"].ToString()))); row.Cells.Add(table.Rows[i]["Descript"].ToString()); //row.Tag gridMain.Rows.Add(row); } gridMain.EndUpdate(); for (int i = 0; i < table.Rows.Count; i++) { if (table.Rows[i]["ReqNeededNum"].ToString() == selected.ToString()) { gridMain.SetSelected(i, true); break; } } gridMain.ScrollValue = scroll; }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { Userod user = Userods.GetUser(ListUser[e.Row].UserNum); FormUserEdit FormU = new FormUserEdit(user); FormU.ShowDialog(); if (FormU.DialogResult == DialogResult.Cancel) { return; } if (Security.CurUser.UserNum == user.UserNum) { Security.CurUser = FormU.UserCur; //if user changed their own password, this keeps the CurUser synched. Needed for eCW bridge. } FillUsers(); for (int i = 0; i < ListUser.Count; i++) { if (ListUser[i].UserNum == FormU.UserCur.UserNum) { gridMain.SetSelected(i, true); SelectedGroupNum = FormU.UserCur.UserGroupNum; } } FillTreePerm(); changed = true; }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { int currentSelection = gridMain.GetSelectedIndex(); int currentScroll = gridMain.ScrollValue; Patient pat = Patients.GetPat(_listPlannedAppts[e.Row].PatNum); //Only one can be selected at a time in this grid. FormOpenDental.S_Contr_PatientSelected(pat, true); FormApptEdit FormAE = new FormApptEdit(_listPlannedAppts[e.Row].AptNum); FormAE.PinIsVisible = true; FormAE.ShowDialog(); if (FormAE.DialogResult != DialogResult.OK) { return; } if (FormAE.PinClicked) { SendPinboard_Click(); DialogResult = DialogResult.OK; } else { RefreshAptList(); FillGrid(); gridMain.SetSelected(currentSelection, true); gridMain.ScrollValue = currentScroll; } }
private void FormSites_Load(object sender, System.EventArgs e) { if (IsSelectionMode) { butClose.Text = Lan.g(this, "Cancel"); if (!Security.IsAuthorized(Permissions.Setup, true)) { butAdd.Visible = false; } } else { butOK.Visible = false; butNone.Visible = false; } FillGrid(); if (SelectedSiteNum != 0) { for (int i = 0; i < _listSites.Count; i++) { if (_listSites[i].SiteNum == SelectedSiteNum) { gridMain.SetSelected(i, true); break; } } } }
private void FillGrid() { int selectionIndex = -1; gridFormats.BeginUpdate(); gridFormats.Rows.Clear(); for (int i = 0; i < formats.Length; i++) { ODGridRow row = new ODGridRow(); row.Cells.Add(formats[i].formatNumber.ToString()); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsOpenGL(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsWindow(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsBitmap(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatUsesPalette(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsAcceleration(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsDoubleBuffering(formats[i].pfd)?"Yes":"No"); row.Cells.Add(formats[i].pfd.cColorBits.ToString()); row.Cells.Add(formats[i].pfd.cDepthBits.ToString()); gridFormats.Rows.Add(row); if (formats[i].formatNumber == selectedFormatNum) { selectionIndex = i; } } gridFormats.EndUpdate(); if (selectionIndex >= 0) { gridFormats.SetSelected(selectionIndex, true); } }
private void grid_CellDoubleClick(object sender, ODGridClickEventArgs e) { int currentSelection = e.Row; int currentScroll = grid.ScrollValue; SelectedPatNum = ListASAP[e.Row].PatNum; FormApptEdit FormAE = new FormApptEdit(ListASAP[e.Row].AptNum); FormAE.PinIsVisible = true; FormAE.ShowDialog(); if (FormAE.DialogResult != DialogResult.OK) { return; } if (FormAE.PinClicked) { PinClicked = true; AptSelected = ListASAP[e.Row].AptNum; DialogResult = DialogResult.OK; } else { FillGrid(); grid.SetSelected(currentSelection, true); grid.ScrollValue = currentScroll; } }
private void grid_CellDoubleClick(object sender, ODGridClickEventArgs e) { int currentSelection = e.Row; //tbApts.SelectedRow; int currentScroll = grid.ScrollValue; //tbApts.ScrollValue; Patient pat = Patients.GetPat(_listUnschedApt[e.Row].PatNum); //If multiple selected, just take the one that was clicked on. FormOpenDental.S_Contr_PatientSelected(pat, true); FormApptEdit FormAE = new FormApptEdit(_listUnschedApt[e.Row].AptNum); FormAE.PinIsVisible = true; FormAE.ShowDialog(); if (FormAE.DialogResult != DialogResult.OK) { return; } if (FormAE.PinClicked) { SendPinboard_Click(); //Whatever they double clicked on will still be selected, just fire the event. DialogResult = DialogResult.OK; //this is an obsolete line. Window stays open. } else { FillGrid(); grid.SetSelected(currentSelection, true); grid.ScrollValue = currentScroll; } }
//private void tbApts_CellDoubleClicked(object sender, CellEventArgs e){ //} private void grid_CellDoubleClick(object sender, ODGridClickEventArgs e) { int currentSelection = e.Row; //tbApts.SelectedRow; int currentScroll = grid.ScrollValue; //tbApts.ScrollValue; FormApptEdit FormAE = new FormApptEdit(ListUn[e.Row]); FormAE.PinIsVisible = true; FormAE.ShowDialog(); if (FormAE.DialogResult != DialogResult.OK) { return; } if (FormAE.PinClicked) { PinClicked = true; CreateCurInfo(ListUn[e.Row]); DialogResult = DialogResult.OK; } else { FillGrid(); grid.SetSelected(currentSelection, true); grid.ScrollValue = currentScroll; } }
private void FormProviderSelect_Load(object sender, System.EventArgs e) { FillGrid(); if (SelectedProvNum != 0) { gridMain.SetSelected(Providers.GetIndex(SelectedProvNum), true); } }
private void FormReferralsPatient_Load(object sender, EventArgs e) { if (ProcNum != 0) { Text = Lan.g(this, "Referrals"); butAddFrom.Visible = false; } else //all for patient { checkShowAll.Visible = false; //we will always show all } FillGrid(); if (RefAttachList.Count > 0) { gridMain.SetSelected(0, true); } }
private void FormLabCaseSelect_Load(object sender, System.EventArgs e) { FillGrid(); if (labCaseList.Count > 0) { gridMain.SetSelected(0, true); } }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { if (!Security.IsAuthorized(Permissions.Schedules, DateTime.MinValue)) { return; } if (textDateFrom.errorProvider1.GetError(textDateFrom) != "" || textDateTo.errorProvider1.GetError(textDateTo) != "") { MsgBox.Show(this, "Please fix errors first."); return; } int clickedCol = e.Col; if (!checkWeekend.Checked) { clickedCol++; } //the "clickedCell" is in terms of the entire 7 col layout. Point clickedCell = new Point(clickedCol, e.Row); DateTime selectedDate = Schedules.GetDateCal(PIn.Date(textDateFrom.Text), e.Row, clickedCol); if (selectedDate < PIn.Date(textDateFrom.Text) || selectedDate > PIn.Date(textDateTo.Text)) { return; } //MessageBox.Show(selectedDate.ToShortDateString()); FormScheduleDayEdit FormS = new FormScheduleDayEdit(selectedDate); FormS.ShowDialog(); if (FormS.DialogResult != DialogResult.OK) { return; } FillGrid(); if (checkWeekend.Checked) { gridMain.SetSelected(clickedCell); } else { gridMain.SetSelected(new Point(clickedCell.X - 1, clickedCell.Y)); } changed = true; }
///<summary></summary> public void FormSelectPatient_Load(object sender, System.EventArgs e) { if (SelectionModeOnly) { groupAddPt.Visible = false; } for (int i = 0; i < DefB.Short[(int)DefCat.BillingTypes].Length; i++) { listBillingTypes.Items.Add(DefB.Short[(int)DefCat.BillingTypes][i].ItemName); } FillSearchOption(); SetGridCols(); if (InitialPatNum != 0) { Patient iPatient = Patients.GetLim(InitialPatNum); textLName.Text = iPatient.LName; FillGrid(); /*if(grid2.CurrentRowIndex>-1){ * grid2.UnSelect(grid2.CurrentRowIndex); * } * for(int i=0;i<PtDataTable.Rows.Count;i++){ * if(PIn.PInt(PtDataTable.Rows[i][0].ToString())==InitialPatNum){ * grid2.CurrentRowIndex=i; * grid2.Select(i); * break; * } * }*/ gridMain.SetSelected(false); for (int i = 0; i < PtDataTable.Rows.Count; i++) { if (PIn.PInt(PtDataTable.Rows[i][0].ToString()) == InitialPatNum) { gridMain.SetSelected(i, true); break; } } return; } if (!checkUseSearch.Checked) { FillGrid(); } }
///<summary></summary> private void FillGrid() { Cursor = Cursors.WaitCursor; //ListAll: Set externally before loading. gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("Employer", 100); gridMain.Columns.Add(col); col = new ODGridColumn("Carrier", 100); gridMain.Columns.Add(col); col = new ODGridColumn("Phone", 82); gridMain.Columns.Add(col); col = new ODGridColumn("Address", 100); gridMain.Columns.Add(col); col = new ODGridColumn("City", 80); gridMain.Columns.Add(col); col = new ODGridColumn("ST", 25); gridMain.Columns.Add(col); col = new ODGridColumn("Zip", 50); gridMain.Columns.Add(col); col = new ODGridColumn("Group#", 70); gridMain.Columns.Add(col); col = new ODGridColumn("Group Name", 90); gridMain.Columns.Add(col); col = new ODGridColumn("Subs", 40); gridMain.Columns.Add(col); col = new ODGridColumn("Plan Note", 180); gridMain.Columns.Add(col); //TrojanID and PlanNote not shown gridMain.Rows.Clear(); ODGridRow row; Carrier carrier; for (int i = 0; i < ListAll.Length; i++) { row = new ODGridRow(); row.Cells.Add(Employers.GetName(ListAll[i].EmployerNum)); carrier = Carriers.GetCarrier(ListAll[i].CarrierNum); row.Cells.Add(carrier.CarrierName); row.Cells.Add(carrier.Phone); row.Cells.Add(carrier.Address); row.Cells.Add(carrier.City); row.Cells.Add(carrier.State); row.Cells.Add(carrier.Zip); row.Cells.Add(ListAll[i].GroupNum); row.Cells.Add(ListAll[i].GroupName); row.Cells.Add(ListAll[i].NumberSubscribers.ToString()); row.Cells.Add(ListAll[i].PlanNote); gridMain.Rows.Add(row); } gridMain.EndUpdate(); gridMain.SetSelected(0, true); Cursor = Cursors.Default; }
private void gridMain_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { bool isCat = false; long selectedKey = 0; if (gridMain.Rows[e.Row].Tag.GetType() == typeof(CovCat)) { isCat = true; selectedKey = ((CovCat)gridMain.Rows[e.Row].Tag).CovCatNum; FormInsCatEdit FormE = new FormInsCatEdit((CovCat)gridMain.Rows[e.Row].Tag); FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } } else //covSpan { selectedKey = ((CovSpan)gridMain.Rows[e.Row].Tag).CovSpanNum; FormInsSpanEdit FormE = new FormInsSpanEdit((CovSpan)gridMain.Rows[e.Row].Tag); FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } } changed = true; FillSpans(); for (int i = 0; i < gridMain.Rows.Count; i++) { if (isCat && gridMain.Rows[i].Tag.GetType() == typeof(CovCat) && selectedKey == ((CovCat)gridMain.Rows[i].Tag).CovCatNum) { gridMain.SetSelected(i, true); } if (!isCat && gridMain.Rows[i].Tag.GetType() == typeof(CovSpan) && selectedKey == ((CovSpan)gridMain.Rows[i].Tag).CovSpanNum) { gridMain.SetSelected(i, true); } } }