public ActionResult CreateSubGr() { ScheduleContext sc = new ScheduleContext(); List <EditUserViewModel> listst = sc.GetStudents(); var studGroups = from stud in listst group stud by stud.Group; List <string> groups = new List <string>(); foreach (IGrouping <string, EditUserViewModel> g in studGroups) { groups.Add(g.Key); } ViewData["ListStud"] = new SelectList(groups); return(View("SubGroupView")); }