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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:15:45+00:00 2026-05-26T12:15:45+00:00

The problems is simple: when ItemsSource is updated Combobox doesn’t refresh e.g. new items

  • 0

The problems is simple: when ItemsSource is updated Combobox doesn’t “refresh” e.g. new items don’t appear to be added to the list of items in the combobox.

I’ve tried the solution from aceepted answer to this question: WPF – Auto refresh combobox content with no luck.

here’s my code,
XAML:

<ComboBox Name="LeadTypeComboBox" ItemsSource="{Binding LeadTypeCollection}" />

ViewModel:

public ObservableCollection<XmlNode> LeadTypeCollection { get; set; }

the way I update this collection is in the separate method, which loads data from updated XML file: this.LeadTypeCollection = GetLeadTypesDataSource();

I’ve also tried using Add for testing purposes:

this.LeadTypeCollection = GetLeadTypesDataSource();
ItemToAdd = LeadTypeCollection[LeadTypeCollection.Count - 1];
this.LeadTypeCollection.Add(ItemToAdd);

the code updating collection definitely kicks off, I can see new items in this collection when debugging, but I don’t see them in the combobox.

Doing this in the xaml code-behind works: LeadTypeComboBox.ItemsSource = MyViewModel.GetLeadTypesDataSource(); but I’d like to achieve this with MVVM, i.e. the code must be in ViewModel which isn’t aware of LeadTypeComboBox control.

  • 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-26T12:15:45+00:00Added an answer on May 26, 2026 at 12:15 pm

    I think I have seen this before and the solution was to update the collection property to raise the change.

    i.e.

    public class MyViewModel : INotifyPropertyChanged
    {
        private ObservableCollection<XmlNode> leadTypeCollection;
    
        public string LeadTypeCollection
        { 
            get { return leadTypeCollection; }
            set
            {
                if (value != leadTypeCollection)
                {
                    leadTypeCollection = value;
                    NotifyPropertyChanged("LeadTypeCollection");
                }
            }
    
        public MyViewModel()
        {
            leadTypeCollection = new ObservableCollection<XmlNode>();
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
    
        private void NotifyPropertyChanged(String info)
        {
            PropertyChanged.Raise(this, info);
        }
    }
    

    I have an extension method for raising the property (as found elsewhere on stackoverflow):

    public static void Raise(this PropertyChangedEventHandler handler, object sender, string propertyName)
    {
        if (null != handler)
        {
            handler(sender, new PropertyChangedEventArgs(propertyName));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problems deploying a simple WebServices app (like Hello World simple) to OC4J.
I'm looking for (simple) examples of problems for which JMS is a good solution,
I have a simple Scala project that runs without any problems inside Eclipse, however,
I am experiencing some performance problems when creating a very simple Python HTTP server.
I'm trying to find a simple MySQL statement for the following two problems: I
This is probably got a simple answer to it, but I am having problems
I think this is going to be one of those simple-when-you-see-it problems, but it
I'm trying to make a simple blackjack program. Sadly, I'm having problems right off
I have a simple UserControl containing Label, ComboBox and Button. In brief, it is
I want to display a important list of items using an ItemsControl. The reason

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.