Please can you tell me how can I bind combobox.
I had combobox which Itemsource is ObservableCollection<strings>. I wont to set Selected Combobox value to MainObject.SomeValue and vice versa.
Which is the easiest way
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’s a little example.
I have two classes:
The DataProvider provides the string data for the combo box and the Person is the object where you want to bind the name. This can be done as followed:
This is just a quick example. Have a look at SelectedItem, SelectedValue, SelectedValuePath if you don’t want to use string as input data…
Is this what you needed?
BR,
TJ