I have created a MultiSelectList like this:
MultiSelectList UsergroupID = new MultiSelectList(_ug.GetUsergroups(), "UsergroupID", "UsergroupName", u.Usergroups);
problem is the getting the list from u.Usergroups (that is EntitySet) to make the items selected.
Do I need to cast “u.Usergroups” to something in order for it to select those?
/M
This can be solved by using LINQ and the “select new” keyword.
Then you add the userGroups items to the MultiSelectList.
P.S. Not sure if it should be SelectListItem for the MultiSelectList type.