private void button1_Click(object sender, EventArgs e) { Debug.Assert(Owner != null, nameof(Owner) + " != null"); narv main = Owner as narv; DataRow nRow = main.autoDataSet1.Tables[0].NewRow(); if (main != null) { nRow[0] = tbn.Text; nRow[1] = tbr.Text; nRow[2] = tbs.Text; nRow[3] = tbd.Text; nRow[4] = tbsum.Text; main.autoDataSet1.Tables[0].Rows.Add(nRow); main.narvTableAdapter.Update(main.autoDataSet1.narv); main.autoDataSet1.Tables[0].AcceptChanges(); main.dataGridView1.Refresh(); tbn.Text = ""; tbr.Text = ""; tbs.Text = ""; tbd.Text = ""; tbsum.Text = ""; } }
private void нарушенияВодителейToolStripMenuItem_Click(object sender, EventArgs e) { narv newForm = new narv(); newForm.Owner = this; newForm.Show(); }
private void button1_Click(object sender, EventArgs e) { narv main = this.Owner as narv; if (main != null) { for (int i = 0; i < main.dataGridView1.RowCount; i++) { main.dataGridView1.Rows[1].Selected = false; for (int j = 0; j < main.dataGridView1.ColumnCount; j++) { if (main.dataGridView1.Rows[i].Cells[j].Value != null) { if (main.dataGridView1.Rows[i].Cells[j].Value.ToString().Contains(tbstr.Text)) { main.dataGridView1.Rows[i].Selected = true; break; } } } } } }