Assume I have a collection of items and want to bind them to a ComboBox/ListBox. In this case Combo/ListBox will contain all items from the collection. What if I want to add some other items to the ComboBox/ListBox which are not the part of the collection itself. For example, I have a collection of numbers(1,2,3,...,10) and want my ComboBox to hold this collection and item with text "All" so ComboBox will have 11 etems total(the string "All" and 10 numbers). Is it possible to do this using List bound to DataSource of ComboBox and then add string "All" to the ComboBox?
+1
A:
You can just create a new list item and insert it.
ListItem defaultItem = new LiftItem();
defaultItem.Value = "0";
defaultItem.Text = "All";
MyListBoxName.Insert(0, defaultItem);
fat_tony
2010-06-21 08:34:56