Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6082795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:19:44+00:00 2026-05-23T11:19:44+00:00

I have a DataGrid defined as such with a MVVM design pattern: <DataGrid Margin=10

  • 0

I have a DataGrid defined as such with a MVVM design pattern:

<DataGrid Margin="10" Height="385" Width="1000" ItemsSource="{Binding Inspection.Details}" SelectedItem="{Binding SelectedDetail, Mode=TwoWay}" AutoGenerateColumns="False" CanUserAddRows="False" x:Name="grdDetails" CanUserSortColumns="True" HorizontalScrollBarVisibility="Visible" CanUserResizeColumns="True">
     <DataGrid.Columns>
        <DataGridTemplateColumn   Header="Code" Width="120" SortMemberPath="MFGCode">
          <DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
             <Grid>
                 <ComboBox FontSize="20" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.MFGCodes}" DisplayMemberPath="Value" SelectedValuePath="Value"  SelectedValue="{Binding MFGCode,Mode=TwoWay}"></ComboBox>
             </Grid>
           </DataTemplate>
         </DataGridTemplateColumn.CellTemplate>
      </DataGridTemplateColumn>
   </DataGrid.Columns>
</DataGrid>

The Combobox is being populated correctly, by binding to a ObservableCollection within the ViewModel. There are also other columns (not presented here) that are being correctly bound to various properties on an Inspection defined in the view model.

On inital load, the combobox CORRECTLY binds to the selectedvalue on the InspectionDetail that represents the MFGCode.

The only problem is, when I change the value in the combobox, the new SelectedValue is not being saved to the SelectedDetail’s MFGCode property as I would expect with a TwoWay binding.

I can provide ViewModel code as it would be helpful, just ask.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:19:45+00:00Added an answer on May 23, 2026 at 11:19 am

    try this

    SelectedValue="{Binding MFGCode,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have defined a datagrid like this :: <cc:PEDataGrid AutoGenerateColumns=False ItemsSource={Binding Rows} Width=Auto PreviewMouseRightButtonDown=PEGrid_PreviewMouseRightButtonDown
I have defined the datagrid as follows <mx:DataGrid id=dg width=100% height=100% > In the
I have a DataGrid which is as follows:: <wpfkit:DataGrid AutoGenerateColumns=False ItemsSource={Binding} Width=Auto FrozenColumnCount=2 SelectionMode=Extended
I have a datagrid defined in XAML as follows: <toolkit:DataGrid Margin=10,116,62,34 Name=WADataGrid RowBackground=LightYellow AlternatingRowBackground=White
I have a DataGrid whose ItemsSource is bound to a changing Observable Collection. Inside
I have the next code where I defined a WPF toolkit datagrid control called
I have a ContextMenu defined on a Datagrid but want to bind submenu items
I have a ListBox (with ItemTemplate defined in the XAML), and a DataGrid. I
I am using WPF toolkit Datagrid. I have a rowvalidationrule defined on this. to
I have this columns in datagrid wpf <DataGrid.Columns> <DataGridComboBoxColumn SelectedItemBinding={Binding Path=ProductId} DisplayMemberPath=Name SelectedValuePath=Id />

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.