private void button2_Click(object sender, EventArgs e) { List <int> marked = new List <int>(); foreach (DataGridViewRow x in dataGridView1.SelectedRows) { marked.Add((int)x.Cells[0].Value); } var form = new FormCaretakers(); form.dataGridView1.DataSource = form.Dataset.Where(x => marked.Contains(x.identyfikator_dozorcy)).ToList(); form.Show(); }
private void button2_Click(object sender, EventArgs e) { var form = new FormCaretakers(); form.Show(); }