Question

I am using a Silverlight 4 Navigation template. I use a DomainDataSource to load a specific entity called Issue. Each Issue has a Category. But I am not sure of the best way to perform the binding of a combobox so that the combobox is populated with the categories but the selected item is bound to the category of the Issue being edited. I have a method that seems like a total hack. So I would like some adice from the experts.

Was it helpful?

Solution

ComboBox has two different properties you can bind to, it has a ItemsSource, and a SelectedValue.

So in this case you could bind your list of categories tot he ItemsSource, and bind your category on your issue to SelectedValue.

Take a look here for more information: http://johnpapa.net/silverlight/binding-to-silverlight-combobox-and-using-selectedvalue-selectedvaluepath-and-displaymemberpath/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top