I think the best answer might be to convert your Enumerable to SelectListItems before passing to your view, and converting the case to TitleCase then. Some faux code for you:
Given this DataSource:
EnumerableItems = new List<string>() { "ITEM ONE", "ITEM TWO" };
I have this on my ViewModel:
public string BoundValue { get; set; }
public IEnumerable<SelectListItem> SelectListItems { get; set; }
I set the SelectListItems like so:
viewModel.SelectListItems = from e in EnumerableItems
select new SelectListItem
{
Selected = e == dto.BoundValue,
Text = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(e.ToLower()),
Value = e
};
In my view something like:
@Html.DropDownList("BoundValue", new SelectList(Model.SelectListItems, "Value", "Text"), "-- select --")
And I get this:
Theoretically I think you could also change the case in the view by calling the ToTileCase where the "Text" argument is, but that would be less clean I think.
EDIT: I amended the code for creating the SelectListItem to have the Value remain uppercase (as e, instead of e.ToTitleCase()) - since I guess it will bind to your original data source ultimately :)