After typing text into a combobox during run time, how do I add it to the combobox’s items property? This is in C# 2010.
Share
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.
The simple solution should be something like
A more elaborate solution would be perhaps to bind your Combobox.Items to some
ObservableCollectionin your ViewModel, and on some event (user presses Enter, etc.) the collection is updated by adding the new text (if it’s still not there). This solution assumes WPF and MVVM-like approach.