How can I combine two fields in a SelectList text description?

you could do something like this:

ViewData["accountlist"] = 
    new SelectList((from s in time.Anagrafica_Dipendente.ToList() select new { 
        ID_Dipendente=s.ID_Dipendente,
        FullName = s.Surname + " " + s.Name}), 
        "ID_Dipendente", 
        "FullName", 
        null);

Leave a Comment