views:

218

answers:

2

I have a combobox which i am binding to a sortedDictionary list, so it displays in ascending order. My question is, I need to display "--Select--" as the first option. Is there any way to either: 1) add another item besides for the datasource or 2) add an unsorted item to the top of the sortedDictionary

any other ideas welcome as well :)

TIA

A: 

In the ascii sorting sequence, 11 characters ! " # $ % & ' ( ) + , come before -.

If it is not likely that your list of entries will start with any one of these characters, then adding your "-- Select --" item and resorting the list will result in "-- Select --" appearing at the top of the list.

Bill
A: 

A bit complicated solution would be writing a wrapper class which will put the --Select-- option at the beginning of your list. I'd like to know how exactly are you binding to the SortedDictionary though, I don't think that combo box accepts a dictionary for its data source.

Bus