Hello
I'm having problems with getting selected items in a select-list.
Product product = _pr.GetProducts().ByProductID(productID).First();
product.Categories.Load();
ICollection<Category> allCategories = _cr.GetCategories().ToList();
List<SelectListItem> Categories = (from category in allCategories
select
new SelectListItem
{
Selected = product.Categories.Contains(category),
Value = category.CategoryID.ToString(),
Text = category.Categoryname
}).ToList();
Categories return 4 items, and selected is false on all....... If I hover "product.Categories" there are 3 items there, which is correct.... but somehow it doesnt get set to true.
What might be wrong? /M