private void dataGridView2_RowEnter(object sender, DataGridViewCellEventArgs e) { if (dataGridView2.SelectedCells.Count == 0) return; if (e.ColumnIndex == 2) { dataGridView2.EditMode = DataGridViewEditMode.EditOnEnter; } var x = GUI.listToLView.Find( (w1) => { return w1.old_litem == e.RowIndex; } ); if (x == null) return; GUI.tofieldlist((StructureTypeDescriptor)x.new_item, dataGridView3, checkBox2.Checked); GUI.tofieldlist((StructureTypeDescriptor)x.old_item, dataGridView4, checkBox2.Checked); selectedrow = x; }
private static void addtoduallist(Form1 form1, StructureTypeDescriptor sd1, StructureTypeDescriptor sd2) { int rid1 = form1.dataGridView1.Rows.Add(); int rid2 = form1.dataGridView2.Rows.Add(); if (sd1 == null) { form1.dataGridView1.Rows[rid1].Cells[0].Value = "-"; form1.dataGridView1.Rows[rid1].Cells[1].Value = ""; } else { form1.dataGridView1.Rows[rid1].Cells[0].Value = sd1._Name; form1.dataGridView1.Rows[rid1].Cells[1].Value = sd1.Fields.Length.ToString(); form1.dataGridView1.Rows[rid1].Cells[2].Value = sd1.CustomName; } if (sd2 == null) { form1.dataGridView2.Rows[rid2].Cells[0].Value = "-"; form1.dataGridView2.Rows[rid2].Cells[1].Value = ""; } else { form1.dataGridView2.Rows[rid2].Cells[0].Value = sd2._Name; form1.dataGridView2.Rows[rid2].Cells[1].Value = sd2.Fields.Length.ToString(); form1.dataGridView1.Rows[rid2].Cells[2].Value = sd2.CustomName; } var ltlv = new ListToLView(sd2, sd1, rid1, rid2); if ((sd1 != null) & (sd2 != null)) ltlv.compactivility = comparefields(sd1.Fields, sd2.Fields); listToLView.Add(ltlv); }
private void dataGridView1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Back) { if (navigation.Count <= 1) return; navigation.RemoveAt(navigation.Count - 1); int members = navigation.Count - 1; var x = GUI.listToLView.Find( (w1) => { return w1.old_litem == navigation[members]; } ); if (x == null) return; dataGridView1.Rows[navigation[members]].Selected = true; if (dataGridView1.Rows[navigation[members]].Displayed == false) { dataGridView1.FirstDisplayedScrollingRowIndex = navigation[members]; } GUI.tofieldlist((StructureTypeDescriptor)x.new_item, dataGridView3, checkBox2.Checked); GUI.tofieldlist((StructureTypeDescriptor)x.old_item, dataGridView4, checkBox2.Checked); selectedrow = x; } }