DropDownList still doesn't support optgroups?

Am I crazy, or am I seeing that you still can't do optgroups in a DropDownList in v2 of ASP.NET? It's one thing making the controls XHTML compliant, quite another having them do everything the XHTML schema will allow. You can't even inherit ListItem to hack out your own version. Lame!

Not that it's hard to implement, but come on guys... don't take short cuts!

14 Comments

  • try my grouplist control:

    http://www.cnblogs.com/Files/bestcomy/WebControlTest.rar

  • What is an "optgroup"? When experienced developers throw around jargon it's difficult for lesser-coders like me to follow and learn this ASP.NET stuff. Sorry if that's a dumb question.

  • It's a part of HTML 4... it lets you group options in a list into subgroups. For example, look at any current version of vBulletin (the PHP board) at the drop down's at the bottom of the threads that let you jump directly to a forum. You'll see subheads that aren't selectable for each forum category.

  • I think Size does matter's comment said it all - Microsoft does not focus on programmers, it focuses on people who think they are programmers but do not really know much. Once you understand HTML/CSS and server side programming you'll realize how primitive and limiting Asp.Net really is.

  • I, too, have never heard of OPTGROUP -- before this thread, anyway. Do all modern browsers (IE5+, Firefox 1+, Netscape 6+, Safari, Opera) support it, assuming the proper DOCTYPE is set? Is there something like OPTGROUP for checkboxes / radio buttons, too?

  • It works OK in IE6 and Firefox. Haven't tried other browsers.



    I'm not sure how you consider ASP.NET primitive or limiting though. Compared to what?

  • It's not that it's limiting per se, it's just that you have to work so much harder to get exactly what you want if what you want isn't what Microsoft has already done for you. It's very easy to make terrible web sites quickly using ASP.NET, but to get more advanced, you have to be a good programmer.

  • I have to agree with Majik - I've been working with ASP.net for about a year now (having come from classic ASP) and I'm really not convinced it brings much to the party. It's supposed to generate all this cross-browser compliant code, but then it misses out on something pretty basic like OptGroups. What the hell? .net development takes about 50-100% longer than classic, and that's not because I'm learning it - it just does. However, and it's a big however, I have a sneaking suspicion AJAX really is the big deal over the horizon, so I'll keep plugging away...

  • Do we have any updates on optgroup support? Obviously it's not something that's seen in desktop applications so can I assume therefor that microsoft is not keen in supporting it? (Much like adding classes to elements with the 'runat="server"' attribute included - you can set, but you can't add or get the class names)

  • @Majik Sznak:

    I would say PHP allows you to create terrible websites too, albeit less quickly :)

    While "Size does matter" could have just googled for "optgroup", that does not infer at all that ASP.NET is not for "real" programmers.

    Although, it might mean that more developers coming from a fat client background are using ASP.NET to make their transition, since MS's goal was to keep the paradigm similar to that of Windows Forms.

    But I, for one, do not use the forms designers, and write all of my pages in w3c compliant XHTML+CSS. Thanks.

  • Well, I've put together a small extended DropDownList with optgroup support. You can find it at http://www.codeplex.com/SharpPieces

  • Still not in .Net 3!!! BOOO!

  • Still not in .Net 3.5 ... well..

  • Guess what... It's still not there in .NET 4.0

Comments have been disabled for this content.