How can I set the selectedvalue property of a SelectList after it was instantiated without a selectedvalue;
SelectList selectList = new SelectList(items, \"I
I ended up here because SelectListItem is no longer picking the selected value correctly. To fix it, I changed the usage of EditorFor for a "manual" approach:
@foreach (var role in ViewBag.Roles) { if (Model.Roles.First().RoleId == role.Value) { @role.Text } else { @role.Text } }
Hope it helps someone.