private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { Otdelenie otdelenie = (Otdelenie)comboBox1.SelectedItem; comboBox2.DataSource = otdelenie.group; comboBox2.DisplayMember = "Name"; }
private void button1_Click_1(object sender, EventArgs e) { Otdelenie otdelenie = new Otdelenie { Name = textBox1.Text, group = new List <Group>() }; dB.otdelenies.Add(otdelenie); dB.Save(); Close(); }