ASP.NET DropDownList with OptionGroup Support

Why doesn't ASP.NET 2.0 support the element?  I don't know.  But here's the solution for you, if you've been wishing it did.

From the introduction:

ASP.NET 2.0, for all its bells and whistles, lacks the odd bit of functionality for reasons completely unknown. One such notable omission is that of OptionGroup () support in the DropDownList control. For those unfamiliar with the element, it is part of the XHTML standard and has the effect of categorising items in a as the following image shows. Wednesday, September 13, 2006 11:31 AM

This article is part of the GWB Archives. Original Author: Chris J. Breisch

New on Geeks with Blogs