private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { int column = e.ColumnIndex; if (column > 2) { DataGridViewRow row = ((DataGridView)sender).Rows[e.RowIndex]; DataGridViewCell idCell = row.Cells[0]; int id = (int)idCell.Value; FahrstrasseN fs = null; foreach (FahrstrasseN el in _fahrstrassenAnzeige.Fahrstrassen) { if (el.ID == id) { fs = el; break; } } if (fs != null) { BefehlsListe bListe = null; Form frm = null; if (column == 3) { bListe = new BefehlsListe(_model.ZeichnenElemente, false, (string)row.Cells[3].Value); frm = new FrmBefehlsliste(bListe, "Start Befehle"); } else if (column == 4) { bListe = new BefehlsListe(_model.ZeichnenElemente, false, (string)row.Cells[4].Value); frm = new FrmBefehlsliste(bListe, "End Befehle"); } if (bListe != null && frm != null) { FahrstrasseK fskAlt = _model.ZeichnenElemente.FahrstrassenKElemente.Element(_ausgewählteKombiFahrstrasse); if (fskAlt != null) { fskAlt.Selektiert = false; } //this.dataGridView2_SelectionChanged(this.dataGridView2, null); _model.OnAnlageNeuZeichnen(); frm.ShowDialog(); string newValue = bListe.ListenString.Trim().Replace(";", ""); if (column == 3) { row.Cells[3].Value = newValue.Replace(" ", "; "); } else if (column == 4) { row.Cells[4].Value = newValue.Replace(" ", "; ");; } } } } }
private void buttonKoppelung_Click(object sender, EventArgs e) { if (_weiche != null) { FrmBefehlsliste frmBefehlsliste = new FrmBefehlsliste(_weiche.Koppelung, _weiche.KurzBezeichnung + "-Koppelung"); if (frmBefehlsliste.ShowDialog(this) == DialogResult.OK) { // string[][] t = frm.auslesen(); } } }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { _editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); BefehlsListe liste = (BefehlsListe)value; Form frm = new FrmBefehlsliste(liste, "Koppelung"); _editorService.ShowDialog(frm); return(liste); }