Gent pinged me on AIM.
“How do I get a ComboBox prompt?”
“Use the ComboBox prompt property.”
“Yeah, but it leaves once you select an item.”
“Put the prompt as the first item in the dataProvider.”
“Can’t do that for this context.”
“Make a custom list that has a prompt above it, and replace ComboBox’ dropdown with your new list.”
“I can’t, I’m about to go pimpin’ on a Friday night, and your not, so code it, sucka!”
“Pssff, you wish you had this grill. Fine…”
So, I attempted to do so in 2 hours, and gave up. Here are my results. Basically, you put a Label above the List. You then extend ComboBox to override the drop down factory so it uses your List instead. The only uncool part is you have to extend ListBase; kind of frustrating when I’m implementing all those interfaces, only to be forced into an inheritance tree… bleh! Extending ComboBox is a pain in the neck because everything is private; frustrating. Anyway, definitely not production code, but should get you started.
After talking to her majesty, there is actually a usability issue with drop downs on web pages in that, once you select an item, you can no longer “de-select” an item by selecting the prompt again if one doesn’t exist. Therefore, I stick to my original suggestion; throw the prompt item in the dataProvider instead.