in my action method I used
ViewBag.type = new SelectList(
db.UserDetails.AsEnumerable().GroupBy(x => x.type).Select(x => x.First()),
"type",
"type",
user.type);
in my view I used
@Html.DropDownListFor(
m => m.type,
(IEnumerable<SelectListItem>)ViewBag.type,
new { @class = "form-control" })
don't know whats wrong why not showing the selected item on load