« Custom ILists, CheckBoxDataGrid, Merged Arrays | Main | Custom ArrayCollections, Adding New Items to DataGrid »

Custom ILists, ComboBox Prompts

Following up on the last post which showed how to use custom ILists to merge two collections, this post shows how to use a custom IList to concatenate or append two collections.

Such a thing might be useful in a situation where you want to add more than one prompt to a ComboBox. In the example, I have the days of the week to choose from, but also want to add "Every Day", "Weekdays" and "Weekends" without modifying the original days of the week collection. Of course, if you concatenate the two collections, it offsets your selectedIndex.

Download Source
Run Demo


Comments

Great tip, thank you.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)