{ //var cats = faqCategorieService.GetAll().ToList(); var categories = faqCategorieService.GetAll().OrderBy(x => x.Naam) .Select(a => new FaqOverviewModel() { Id = a.Id, Naam = a.Naam }).ToList(); foreach (var categorie in categories) { categorie.Naam = categorie.Naam + " (" + categorie.Id.ToString() + ")"; } categories.Insert(0, new FaqOverviewModel() { Id = -1, Naam = "Maak een keuze..." }); return View(); }
public int SelectedCategoriedFaqId { get; set; } public IEnumerable<SelectListItem> FAQCategorieItems { get { return new SelectList(Categorie, "Id", "Naam"); } }
ViewBag.Title = "Index";
//if (Model.ZorgverzekeraarInvoerEnabled) //{ <span class="fixedLabelWidth">@Html.LabelFor(model => model.SelectedCategoriedFaqId, "Categorie:")</span> @Html.DropDownListFor(x => x.SelectedCategoriedFaqId, Model.FAQCategorieItems ) //@Html.HiddenFor(model => model.ZorgverzekeraarInvoerEnabled) @*<div class="editor-label"> @Html.LabelFor(m => m) </div>*@ @*<div class="editor-field"> <span class="fixedLabelWidth">@Html.LabelFor(model => model.SelectedSubCategorieFaqId, "Onderwerp:")</span> @Html.DropDownListFor(m => m.SelectedSubCategorieFaqId, Model.FaqSubCategorieItems, new { style = "width: 150px" }) </div>*@ <span class="fixedLabelWidth">@Html.LabelFor(model => model.EmailBericht, "Bericht:")</span> @Html.TextAreaFor(x => x.EmailBericht) @*}*@
@Html.DropDownListFor(x => x.SelectedCategoriedFaqId, Model.FAQCategorieItems )