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

  • Home
  • SEARCH
  • 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 6130735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:53:35+00:00 2026-05-23T16:53:35+00:00

I am wandering if anyone could help me work out the binding issues I

  • 0

I am wandering if anyone could help me work out the binding issues I am having?

Snippets of Code:

<DataGrid AutoGenerateColumns="False" Grid.Column="1" Grid.Row="1" SelectionMode="Single" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding PersonList}" CanUserSortColumns="True" SelectedItem="{Binding Path=SelectedPerson}" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="FirstName" Width="100" Binding="{Binding FirstName}" />
                <DataGridTextColumn Header="LastName" Width="100" Binding="{Binding LastName}" />
                <DataGridTemplateColumn Width="140" Header="Operator">
                    <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                        <ComboBox ItemsSource="{Binding Path=OperatorList}" DisplayMemberPath="FullName" SelectedValue="{Binding Path=SelectedOperator}" />
                            </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn> 
                ...
</DataGrid>

Above is a snippet of code from the view:

Each person in the list is its own viewmodel that has the code snippet below:

CollectionView _operatorList;
public CollectionView DebtorAgentList { get { return _operatorList; } }

Model.Operator _selectedOperator;
public Model.Operator SelectedOperator
{...}

Now the problem I am having is that the SelectedValue binding isn’t working and I can’t work out why? But what makes it tricky or different (maybe) is that every row in the data grid has its own viewmodel , so in otherwords a datagrid of viewmodels. So what is happening is that FirstName and LastName and Combobox are all filled correctly but I can’t seem to get the SelectedValue to bind?
P.S. It isnt because of some spell mistake, if there are spelling mistakes is because i renamed methods when I wrote the question etc.

Further Details:

The above Datagrid is part of a view that has its own viewmodel, this view model fills the datagrid above with a list of people, each person is a viewmodel in essence( well it isn’t really a viewmodel but then again its more of a viewmodel than a plane model). It works the way I need it to until I try to bind the SelectedView attribute?

Could someone please tell me why that binding might not working?

Thanks In advance 😀

  • 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-23T16:53:35+00:00Added an answer on May 23, 2026 at 4:53 pm

    I found this article that helped me work it out 🙂
    instead of using a template column I used the DataGridComboBoxColumn, as below:

    <DataGrid AutoGenerateColumns="False" Grid.Column="1" Grid.Row="1" SelectionMode="Single" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding PersonList}" CanUserSortColumns="True" SelectedItem="{Binding Path=SelectedPerson}" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="FirstName" Width="100" Binding="{Binding FirstName}" />
                <DataGridTextColumn Header="LastName" Width="100" Binding="{Binding LastName}" />
                <DataGridComboBoxColumn Header="Operator" DisplayMemberPath="FullName" Width="150" SelectedValueBinding="{Binding Path=SelectedOperator}" >
                    <DataGridComboBoxColumn.ElementStyle>
                    <Style TargetType="ComboBox">
                        <Setter Property="ItemsSource" Value="{Binding Path=OperatorList}" />
                    </Style>
                    </DataGridComboBoxColumn.ElementStyle>
                    <DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="ItemsSource" Value="{Binding Path=OperatorList}" />
                        </Style>
                    </DataGridComboBoxColumn.EditingElementStyle>
                </DataGridComboBoxColumn>
                ...
    </DataGrid>
    

    The rest stayed the same,
    Thanks all 🙂

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

Sidebar

Related Questions

I was wondering if anyone could help me out (not with code, although that
I was wondering if anyone could help me out with jQuery file tree (
I was wondering if anyone could help me out, I'm trying to find a
I was wondering if anyone could help me with this problem i'm having. I
I was just wondering if anyone could help out with how to do the
I was wondering if anyone could help me with the following. I work remotely
I was wondering if anyone could help me troubleshoot some CSS issues I'm running
I was wondering if anyone could help clear up this issue I am having.
Hey there, was wondering if anyone could help a newbie on SQL and Python.
I was wondering if any one could help me out; I have a table

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.