I thought I would share this solution that I came across if others would have the same problem as mine. Im works with generics, and therefore I can not order my source before creating SelectList. However, you can order the created SelectList. I still wanted my method to return SelectList, so I call SelectList () a second time using an ordered SelectList as a source. :)
var orderedSelectList = new SelectList(source, "YourValueFieldName", "YourTextFieldName", selectedCode).OrderBy(i => i.Text); return new SelectList(orderedSelectList, "Value", "Text", selectedCode);
source share