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

The Archive Base Latest Questions

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

(see below for my own answer that I came up with after letting this

  • 0

(see below for my own answer that I came up with after letting this percolate for days & days)
I am trying to achieve the following scenario in WPF.

I have a datagrid that is displaying rows of data for viewing and additional data entry. It is a new app but there is legacy data.

One particular field in the past has had data randomly entered into it. Now we want to limit that field’s values to a particular list. So I’m using a DataGridComboBoxColumn. FWIW I have alternatively tried this with a DataGridTemplateColumn containing a ComboBox.

At runtime, if the existing value is not on the list, I want it to display anyway. I just cannot seem to get that to happen. While I have attempted a vast array of solutions (all failures) here is the one that is most logical as a starting point.

The list of values for the drop down are defined in a windows resource called “months”.

<DataGridComboBoxColumn x:Name="frequencyCombo"   MinWidth="100" Header="Frequency"
   ItemsSource="{Binding Source={StaticResource months}}"
   SelectedValueBinding="{Binding Path=Frequency,UpdateSourceTrigger=PropertyChanged}">
   <DataGridComboBoxColumn.ElementStyle>
     <Style TargetType="ComboBox">
       <Setter Property="IsSynchronizedWithCurrentItem" Value="False" />
     </Style>
   </DataGridComboBoxColumn.ElementStyle>
</DataGridComboBoxColumn>

What is happening is that if a value is not on the list then the display is blank. I have verified at runtime that the IsSynchronizedWithCurrentItem element is indeed False. It is just not doing what I am expecting.

Perhaps I am just going down the wrong path here. Maybe I need to use a textbox in combination with the combobox. Maybe I need to write some code, not just XAML. I have spent hours trying different things and would be really appreciative of a solution. I have had a few suggestions to use this class or that control but without explanation of how to use it.

Thanks a bunch!

  • 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-19T10:19:24+00:00Added an answer on May 19, 2026 at 10:19 am

    I have finally solved this.
    The trick is to get rid of the comboboxcolumn and use a template that has a textbox for display and a combobox for editing. However, I still spent hours with a new problem…when making a selection in the combobox, it would modify any other rows where I had also used the combobox in the grid. Guess what solved the problem! The IsSynchronizedWithCurrentItem property that I was trying to use before. 🙂

     <DataGridTemplateColumn x:Name="frequencyCombo" Header="Frequency">
       <DataGridTemplateColumn.CellTemplate>
         <DataTemplate>
           <TextBlock Text="{Binding Path=Frequency}" />
         </DataTemplate>
       </DataGridTemplateColumn.CellTemplate>
       <DataGridTemplateColumn.CellEditingTemplate>
       <DataTemplate>
         <ComboBox 
           ItemsSource="{Binding Source={StaticResource frequencyViewSource},
           TargetNullValue=''}"
           SelectedItem="{Binding Path=Frequency}" IsSynchronizedWithCurrentItem="False"
          />
        </DataTemplate>
      </DataGridTemplateColumn.CellEditingTemplate>
    </DataGridTemplateColumn>
    

    No ugly hacks. No non-usable choices hanging around at the bottom of the dropdown. No code to add those extra values and then clean them up.

    I am not going to take away the “Answer” on Mark’s suggestion since it enabled me to get the app into my client’s hands, but this is the solution I was looking for. I found it buried in a “connect” item after hours of web searching.

    Thanks for everyones help!

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

Sidebar

Related Questions

I've found a solution, see my own answer below. Does anyone have a more
EDIT - FOUND A EASY 5-10 LINE SOLUTION!!! See MY OWN ANSWER BELOW!!! YAY!!!!!!!!!
EDIT @mootinator has done awesome work with this. See his answer below. Since I
Please see below: I tried using Absolute layout, but that's deprecated. I appreciate your
I have this edmx model (see below) and I would like to add an
Post-answer edit: I think this was a bug in my own code -- I
I have created a 3d map using rgl.surface(), mainly following Shane's answer in this
Edit 4: I was finally able to solve my own issue. See checkmark answer
Please see below code: thrust::device_vector<int>::iterator whereToBegin = copyListOfNgramCounteachdoc.begin(); end = thrust::unique_by_key(end.first, end.first + numUniqueNgrams,end.second);
UPDATE see below I am not sure how to populate a list or vector

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.