Insert initial blank row into select list MVC LINQ SQL

Viewed 29095

I have the following code that is in my formViewModel to be passed to my View.

        var ownerValues = aspnet_Users
            .OrderBy(u => u.Surname)
            .Select(u => new KeyValuePair<int, string>(u.UserId, u.Surname + " " + u.Forename.ToString() + " [" + u.UserName.ToString() + "]"));
        this.OwnersList = new SelectList(ownerValues, "Key", "Value", incidentAction.OwnerId);

When I run the view in explorer my drop list defaults to the first item and I want it to default to a blank row.

So my plan is to insert a initial row with userId = null and then an empty string instead of 'please select' or something similar.

Can anyone please advise me on how to do this on one line of code I think, not sure where to start.

thanks

3 Answers
Related