combobox binding
I'm using the mvvm model, I've setup a property in the view model to retrieve combobox values from the model. The combobox is all fine and I know how to bind the selected value to a property. The combobox value is a value part of the customer table called customer type and the value is customertypeid. how do I set the combobox default value to be value from customer table. And once it's changed how does it update the customer table?
Czhang RegoPosted Nov 27, 2012, 5:16 PM
Shankar MPosted Nov 27, 2012, 3:37 AM
Hi User,
You can use the ComboBox SelectedItem Property or ComboBox SelectedIndex property to do it.
SelectedItem Property:
comboBox1.SelectedItem= "Graduate";
SelectedIndex Property:
comboBox1.SelectedIndex = 1; ( for first Item in the Collection Index is 0,and next is 1 and so on..)
Thanks,
Shankar