private void ComboBoxLoad2(ref List <WellPad> pads) {//loading Well Combo Box depending on what WellPad is selected if (pads != null) { selectedWP = this.WellPadcomboBox.GetItemText(this.WellPadcomboBox.SelectedItem); wellPad = pads.Find(s => s.DisplayComboBox == selectedWP); //Lambda if (wellPad != null) { var filtered = from f in wellPad.Wells //LINQ where (f is ProdWell) select f; WellComboBox.DataSource = filtered.ToList <IWell>(); WellComboBox.DisplayMember = "Id"; } } }
private void ComboBoxLoad2(ref List<WellPad> pads) { //loading Well Combo Box depending on what WellPad is selected if (pads != null) { selectedWP = this.WellPadcomboBox.GetItemText(this.WellPadcomboBox.SelectedItem); wellPad = pads.Find(s => s.DisplayComboBox == selectedWP); //Lambda if (wellPad != null) { var filtered = from f in wellPad.Wells //LINQ where (f is ProdWell) select f; WellComboBox.DataSource = filtered.ToList<IWell>(); WellComboBox.DisplayMember = "Id"; } } }