Well I was wondering how to bind a boolean property to a combobox.Combobox will be a yes/no combobox.
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.
You could use a ValueConverter to convert the boolean value to a ComboBox index and back. Like this:
Assuming Yes is on index 0 and No on index 1. Then you’d have to use that converter in binding to the SelectedIndex property. For this, you declare your converter in your resources section:
Then you use it in your binding: