Closed Tsukasa42 closed 7 years ago
Sorry if I'm missing something, I just discovered your work. Great job.
I'm looking to create a dropdown without a default selection.
With your framework it looks like I would need to use SelectFor.
@Html.Bootstrap().SelectFor(x => x.Account.JobTitle, Model.JobTitleList).SetControlLabel(null).AddAttribute("placeholder", "Job Title")
JobTitle has no value but of course the first one is being selected.
The ViewModel for the list is IEnumerable and the SelectList being passed into it has null set as the selected item.
I managed to make the following work.
.AddOption(null).AddOptions(Model.JobTitleList)
Validation is still triggered with it set to null.
Sorry if I'm missing something, I just discovered your work. Great job.
I'm looking to create a dropdown without a default selection.
With your framework it looks like I would need to use SelectFor.
@Html.Bootstrap().SelectFor(x => x.Account.JobTitle, Model.JobTitleList).SetControlLabel(null).AddAttribute("placeholder", "Job Title")
JobTitle has no value but of course the first one is being selected.
The ViewModel for the list is IEnumerable and the SelectList being passed into it has null set as the selected item.