private void checkUnits_btn_Click(object sender, EventArgs e) { this.Hide(); Unit_table unit_Table = new Unit_table(); unit_Table.Show(); }
private void button1_Click(object sender, EventArgs e) { Unit_table main = this.Owner as Unit_table; if (main != null) { for (int i = 0; i < main.Unit_dataGridView.RowCount; i++) { main.Unit_dataGridView.Rows[1].Selected = false; for (int j = 0; j < main.Unit_dataGridView.ColumnCount; j++) { if (main.Unit_dataGridView.Rows[i].Cells[j].Value != null) { if (main.Unit_dataGridView.Rows[i].Cells[j].Value.ToString().Contains(tbStr.Text)) { main.Unit_dataGridView.Rows[i].Selected = true; break; } } } } } }