// Собитие изменнения типа товара private void cbTypeGoods_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (cbTypeGoods.SelectedItem != null) { TypeGoods typeGoods = cbTypeGoods.SelectedItem as TypeGoods; cbGoods.ItemsSource = _databasenEtities.Goods.Where(a => a.ID_TypeGoods == typeGoods.ID).OrderBy(a => a.Name).ToArray(); } }
public TypeGoodsCol() { for (int i = 0; i < TypeGoodsForm.dataTypeGoods.Rows.Count; i++) { if (TypeGoodsForm.dataTypeGoods[0, i].Value != null) { counter++; } else { break; } } Coll_of_typeGoods = new TypeGoods[counter]; for (int i = 0; i < counter; i++) { Coll_of_typeGoods[i] = new TypeGoods(); Coll_of_typeGoods[i].Name = (String)TypeGoodsForm.dataTypeGoods[1, i].Value; } }