Adding Non-Selectable ListItems To An ASP.NET DropDownList Control
Recently asked on Yahoo! Answers:
Im working in dropdown list box in asp .net
where i wan d dropdown list box to have headin for each 10 item, and the heading should not get selected during run time. Plz help
This is easy to do if you dynamically bind each ListItem to your DropDownList; basically, you introduce a while loop to the mix to occasionally insert the requested number of breaks. Then, we add a CustomValidator control to ensure the user can’t select one of the heading items.
I won’t have a working example but I will provide a text file at the end which contains all the code.
Continue reading ‘Adding Non-Selectable ListItems To An ASP.NET DropDownList Control’ »