Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Combo box edit binding
posted

I am able to set the combo box up in the grid using the template column following the examples on the boards. I am having an issue getting it to bind back to the view model on edit.

I know its the SelectedItem= line, but I'm not sure what it should be. I feel like its something really easy. 

 

<UserControl.Resources>
    <controls:DataContextProxy x:Key="viewModelSpy" />
</UserControl.Resources>
<ig:TemplateColumn Key="fkFFId" HeaderText="Foo F">
    <ig:TemplateColumn.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding fkFFId}" />
        </DataTemplate>
    </ig:TemplateColumn.ItemTemplate>
    <ig:TemplateColumn.EditorTemplate>
        <DataTemplate>
            <ig:XamComboEditor DisplayMemberPath="FooFName"
                                SelectedItem="{Binding pkFFId, Mode=TwoWay}"
                                ItemsSource="{Binding Source={StaticResource viewModelSpy},Path=DataSource.FooF, Mode=TwoWay}"/>
 
        </DataTemplate>
    </ig:TemplateColumn.EditorTemplate>
</ig:TemplateColumn>