I wonder if anyone can shed some light on this problem..
I\'ve got an option group drop-down for selecting a person\'s ethnicity – however it’s not storing the value in
This is supported natively using SelectListGroup as of ASP.NET MVC 5.2:
var items = new List(); var group1 = new SelectListGroup() { Name = "Group 1" }; items.Add(new SelectListItem() { Text = "Item1", Group = group1 });
Then in MVC, do
@Html.DropDownList("select", items)