Question: I have a database, that contains an tinyint column with "1" or "0" for marking as "yes" or "no".

In my razor view I want to Show this in a ListBox. When reading rows out of the database, I want to preselect the corresonding item in the ListBox.

Code here is simplified:

```
var mItems = new List<SelectListItem>{
    new SelectListItem { Value="1", Text="Yes"},
    new SelectListItem { Value="0", Text="No"}
};

int mIsProofed = 0;

// This doesn´t preselect my item:
mItems.Select(x => x.Value == mIsProofed.ToString());

:

@Html.ListBox("mylistbox", mItems)

```

Any ideas how to resolve this?

Answer: 
You need to set the `Selected` property on the [`SelectListItem`](http://msdn.microsoft.com/en-us/library/system.web.mvc.selectlistitem%28v=vs.118%29.aspx). 

I'd update your code to be similar to this:

```
var selectedItem = mItems.FirstOrDefault(x => x.Value == mIsProofed.ToString());
if(selectedItem != null) 
{
     selectedItem.Selected = true;
}

```

This will find the item you wish to select, and update its selected property if it is found, otherwise it does not modify anything.

The [`.Select()` method](http://msdn.microsoft.com/en-us/library/vstudio/bb548891%28v=vs.100%29.aspx) you are using is used to perform a projection on the list, in other words it is more like the `select` command in SQL, where you specify a subset (or the full set) of data.
Try setting the `Selected` property to true:

```
var selected = mItems.Where(x => x.Value == mIsProofed.ToString()).First();
selected.Selected = true;
.
.
@Html.ListBox("mylistbox", mItems)

```