I have a requirement of grouping the drop down list options in ASP.NET drop down server control. Do you have any idea to how to approach the issue? I am new to ASP.NET.
this little improvement to the client side of mhu's excellent solution also works if there are more than one select tags.
With his version, indeed, each select tag gets filled with one copy of each option tag of each select tag
(in this example, .select2 is the class in common to all the select tags)
function filterUserGroups()
{
var groups = {};
$("select option[data-category]").each(function () {
var sGroup = $.trim($(this).attr("data-category"));
groups[sGroup] = true;
});
$.each(groups, function (c) {
$(".select2").each(function () {
$(this).find("option[data-category='" + c + "']").wrapAll('