I’m trying to add a predefined ComboBoxItem into my ComboBox which already has a ItemsSource property set. example:
(Select item)
Item 1
Item 2
Item 3
It’s possible to do this without modifying the original items collection?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is some sample code from MSDN that shows the usage of CompositeCollection:
Here are some references to show you the usage of CompositeCollection:
1- http://msdn.microsoft.com/en-us/library/system.windows.data.compositecollection.aspx
2- http://robertbouillon.com/2010/04/17/adding-items-to-a-data-bound-wpf-combobox/
3- How do I convert a ComboBox to use a bound CompositeCollection?