I am having an issue binding the selected value of a combobox back to its listview column value.
My Listview has a datacontext of Inquiries which is a collection viewsource The ComboBox as a datacontext of Accounts wich is also a collection viewsource
Both display the lists correctly by setting the itemssource to {Binding}
What I need to do is bind the Combobox selectedvalue to the Inquiries row that it sits in.
Here's the Account Column XAML:
<GridViewColumn x:Name="AccountIdColumn" Header="Account" Width="80">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox Margin="-6,-1" DataContext="{StaticResource AccountViewSource}"
ItemsSource="{Binding}"
x:Name="AccountComboBox"
SelectedValuePath="ID"
DisplayMemberPath="Description"
Height="Auto"
SelectedValue="{Binding AccountID, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
And the Listview is set like this:
<ListView DataContext="{StaticResource tbl_InquiriesViewSource}" x:Name="Tbl_InquiriesListView" ItemsSource="{Binding Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True, UpdateSourceTrigger=PropertyChanged}" Margin="10,47,10,10" SelectionMode="Single" SourceUpdated="Tbl_InquiriesListView_SourceUpdated" TargetUpdated="Tbl_InquiriesListView_TargetUpdated" >
<ListView.ItemContainerStyle>
<Style>
<Setter Property="Control.HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Control.VerticalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
....
I know why it's not working, but can't figure out how to get it working.