Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

[RESOLVED] Binding to Parent

$
0
0
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



Code:

ItemsSource="{Binding Path=DataContext.ProductTypes, ReletiveSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
or perhaps like this

Code:

ItemSource=“{Binding DataContext.ProductTypes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}“
Any ideas?

Thanks

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>