Looking all over and found different variations all of which failed me (or Im not using correctly).
Using Calburn.Micro and IdeaBlades DevForce
I have a ViewModel with a bindable collection property say ProductTypes
On the View I an binding my controls to Table1 which has a FK relation to Table2
On this View I have a DataGrid bound to Table2
Now I need to set one of the columns to be a ComboBox which will contain items from the bindable collection property ProductTypes and set its selectedvalue to the Table2 field value.
Trying something like this doesnt even populate the combo
or perhaps like this
Any ideas?
Thanks
Using Calburn.Micro and IdeaBlades DevForce
I have a ViewModel with a bindable collection property say ProductTypes
On the View I an binding my controls to Table1 which has a FK relation to Table2
On this View I have a DataGrid bound to Table2
Now I need to set one of the columns to be a ComboBox which will contain items from the bindable collection property ProductTypes and set its selectedvalue to the Table2 field value.
Trying something like this doesnt even populate the combo
Code:
ItemsSource="{Binding Path=DataContext.ProductTypes, ReletiveSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
Code:
ItemSource=“{Binding DataContext.ProductTypes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}“
Thanks