HTML has an optgroup tag that can be used in a select element; this is supported in all major browsers.
Until now, the ASP.NET DropDownList offers no support for this. The way I see it, there are two possible solutions:
1 - Add a Group property to the ListItem class, which would be used for grouping multiple options together
2 - Add a new GroupedListItem class that inherits from ListItem and add a group property to it
The DropDownList control would need to group all items by their group text (if available) and render them all inside of a optgroup.
copied over from: https://aspnet.codeplex.com/workitem/10318
posted workaround by user: http://weblogs.asp.net/ricardoperes/archive/2013/02/02/asp-net-dropdownlist-with-groups.aspx
Until now, the ASP.NET DropDownList offers no support for this. The way I see it, there are two possible solutions:
1 - Add a Group property to the ListItem class, which would be used for grouping multiple options together
2 - Add a new GroupedListItem class that inherits from ListItem and add a group property to it
The DropDownList control would need to group all items by their group text (if available) and render them all inside of a optgroup.
copied over from: https://aspnet.codeplex.com/workitem/10318
posted workaround by user: http://weblogs.asp.net/ricardoperes/archive/2013/02/02/asp-net-dropdownlist-with-groups.aspx