private void FillGrid() { AnesthMedSuppliers.RefreshCache(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); textAlign = HorizontalAlignment.Center; ODGridColumn col = new ODGridColumn(Lan.g(this, "SupplierName"), 200, textAlign); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Phone"), 100, textAlign); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Fax"), 100, textAlign); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "City"), 140, textAlign); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "State"), 160, textAlign); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "WebSite"), 140, textAlign); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < AnesthMedSupplierC.Listt.Count; i++) { row = new ODGridRow(); row.Cells.Add(AnesthMedSupplierC.Listt[i].SupplierName); row.Cells.Add(AnesthMedSupplierC.Listt[i].Phone); row.Cells.Add(AnesthMedSupplierC.Listt[i].Fax); row.Cells.Add(AnesthMedSupplierC.Listt[i].City); row.Cells.Add(AnesthMedSupplierC.Listt[i].State); row.Cells.Add(AnesthMedSupplierC.Listt[i].WebSite); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e) { FormAnesthMedSuppliersEdit FormME = new FormAnesthMedSuppliersEdit(); FormME.SupplCur = AnesthMedSupplierC.Listt[e.Row]; FormME.ShowDialog(); AnesthMedSuppliers.RefreshCache(); FillGrid(); }