Пример #1
0
        private async void lstbx_types_SelectedIndexChanged(object sender, EventArgs e)
        {
            ((ListBox)chbxlist_ingrs).DataSource = null;

            if (editProduct == null)
            {
                return;
            }

            editProduct.ProductTypeID = (ProductType)lstbx_types.SelectedItem;

            ((ListBox)chbxlist_ingrs).DataSource = await _repo.GetAllowedIngredientsByPTypeAsync(editProduct.ProductTypeID);

            ((ListBox)chbxlist_ingrs).DisplayMember = "IngredientName";
            ((ListBox)chbxlist_ingrs).ValueMember   = "IngredientID";
        }