开发者

ComboBox Binding to display list but bind selection to entity?

开发者 https://www.devze.com 2023-02-12 19:09 出处:网络
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

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 开发者_StackOverflowis 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.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消