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 6723841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:37:02+00:00 2026-05-26T09:37:02+00:00

Been looking around for about 4 hours so if the answer is here somewhere

  • 0

Been looking around for about 4 hours so if the answer is here somewhere i’m sorry.
Anyway.. here goes:

I have a DataGrid and am trying to implement a DatGridComboBoxColumn.
I have gotten as far as managing to get it to come up with correct data. However, when i make a selection it changes not only the column selected but also another column in the master table.

Specifically:

my Groups table looks like this:

Id,Name

1,A

2,B

3,C

If I select A in the DataGridComboBoxColumn it changes the GroupId field in the Schedules DataSource to the right value, 1.
But – it also changes the Name field in the Schedules DataSource to “A”.
I have tried about 70 different combinations of how to set things.
The only thing that has worked in to rename the Name field in Schedules to something else like ScheduleName. Is this some kind of bug in WPF or am i not coding something right?

Any help will be much appreciated!

Orson

Here is the Page code:

<Page x:Class="Bix.SchedulesMainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="565" d:DesignWidth="775"
    Title="SchedulesMainPage" xmlns:my="clr-namespace:Bix">
    <Page.Resources>
        <ObjectDataProvider x:Key="ScheduleDataProvider" ObjectType="{x:Type my:ScheduleDataProvider}"/>
        <ObjectDataProvider x:Key="Schedules"
          ObjectInstance="{StaticResource ScheduleDataProvider}"
          MethodName="GetSchedules"/>
        <ObjectDataProvider x:Key="GroupDataProvider" ObjectType="{x:Type my:GroupDataProvider}"/>
        <ObjectDataProvider x:Key="Groups"
          ObjectInstance="{StaticResource GroupDataProvider}"
          MethodName="GetGroups"/>
        <ObjectDataProvider x:Key="ReportDataProvider" ObjectType="{x:Type my:ReportDataProvider}"/>
        <ObjectDataProvider x:Key="Reports"
          ObjectInstance="{StaticResource ReportDataProvider}"
          MethodName="GetReports"/>
    </Page.Resources>
    <Grid>
        <Label Content="Schedules" FontSize="32" FontWeight="Bold" Foreground="#FF5A5A5A" Height="52" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label1" VerticalAlignment="Top" Width="719" />
        <DataGrid AutoGenerateColumns="False" DataContext="{Binding Source={StaticResource Schedules}}" Height="224" HorizontalAlignment="Left" HorizontalGridLinesBrush="#FFCBCBCB" ItemsSource="{Binding}" Margin="12,68,0,0" Name="dgrdContacts" VerticalAlignment="Top" VerticalGridLinesBrush="#FFCBCBCB" Width="751">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=Name}" Header="Name" Width="120" />
                <DataGridComboBoxColumn Header="Contact Group"
                    SelectedValueBinding="{Binding Path=GroupId}" DisplayMemberPath="Name" SelectedValuePath="Id" ItemsSource="{Binding Source={StaticResource Groups}}">
                    <DataGridComboBoxColumn.ElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="ItemsSource" Value="{Binding Source={StaticResource Groups}}" />
                            <Setter Property="Text" Value="{Binding Name}" />
                        </Style>
                    </DataGridComboBoxColumn.ElementStyle>
                    <DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="ItemsSource" Value="{Binding Source={StaticResource Groups}}" />
                            <Setter Property="Text" Value="{Binding Name}" />
                        </Style>
                    </DataGridComboBoxColumn.EditingElementStyle>
                </DataGridComboBoxColumn>
                <DataGridTextColumn Binding="{Binding Path=Interval}" Header="Send Every" Width="120" />
                <DataGridTextColumn Binding="{Binding Path=IntervalUnit}" Header="Time Unit" Width="120" />
                <DataGridTextColumn Binding="{Binding Path=LastSend}" Header="Last Sent" Width="*" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>
  • 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-26T09:37:02+00:00Added an answer on May 26, 2026 at 9:37 am

    You’re binding the Text property of the ComboBox to the Name property on the underlying row in the data source. Looking at the code, I don’t see any need for the EditingElementStyle and ElementStyle styles, since you’re already setting the relevant properties outside of it.

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

Sidebar

Related Questions

I have been looking around on the web and found some articles about the
I have been looking around for solutions, and tried to implement what is often
I've been looking around trying to determine some Hibernate behavior that I'm unsure about.
Ok so I have been looking around at just about every option under the
I have been looking around for this but couldn't find an answer anywhere, so
I've been looking around for quite a while and feel that I have a
I have been looking around ocn Google and Stackoverflow but haven't found what I
I've been looking around on SO and have been seeing a lot of questions
**Updated: (See below)**I have been looking around for couple of days and can't find
I have been looking around and I find grep and Gawk fairly difficult to

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.