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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:47:02+00:00 2026-06-05T20:47:02+00:00

I am having a binding update problem with my ComboBox. My ComboBox’s ItemSource is

  • 0

I am having a binding update problem with my ComboBox. My ComboBox’s ItemSource is bound to a list of LaneConfigurations. The ComboBox’s SelectedItem is bound to the SelectedLaneConfiguration property in my code-behind. I configured the ComboBox’s ItemTemplate to display the ‘DisplayID’ property for each LaneConfiguration.

This works most of the time. However, changing a lane configuration can result in the DisplayID changing. If you have a particular lane selected and it’s DisplayID is being displayed as the ‘Text’ of the ComboBox and then you change the LaneConfiguration object, the ‘Text’ portion of the ComboBox is not updated with the new ‘DisplayID’ that should be showing. When I click the dropdown arrow on the ComboBox, the item appearing as the selected item in the list is showing the correct DisplayID, but that doesn’t match the ‘DisplayID’ that is being shown at the top of the ComboBox in it’s ‘Text’ field.

In my code behind, I am firing a PropertyChanged event on the ‘SelectedLaneConfiguration’ property. How do I get the ComboBox to realize that the ‘DisplayID’ property needs updating? I have tried to fire a PropertyChanged event for the ‘DisplayID’ property, but it is part of the LaneConfiguration class, so it doesn’t appear to be updating.

I have included the XAML below along with a screenshot that shows the ComboBox Text display out of sync with the content of the ComboBox dropdown.

ScreenShot

Partial XAML:

<ComboBox x:Name="_comboBoxLanes" Height="26"
          ItemsSource="{Binding SensorConfiguration.LaneConfigurations}" 
          SelectedItem="{Binding Path=SelectedLaneConfiguration}">
     <ComboBox.ItemTemplate>
        <DataTemplate>
           <TextBlock Text="{Binding DisplayID, Mode=OneWay}"/>
        </DataTemplate>
     </ComboBox.ItemTemplate>
</ComboBox>

Some of the code-behind:

    public partial class LaneManagement : INotifyPropertyChanged, IDisposable
    {
        ..
        ..

        public event PropertyChangedEventHandler PropertyChanged;

        private void FirePropertyChanged(string prop)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(prop));
            }
        }

        private void SensorConfiguration_Changed()
        {
            LaneTools.ResetLanePolygons();
            GenerateLaneTypeDropdowns();
            FirePropertyChanged("SensorConfiguration");
            FirePropertyChanged("SelectedLaneConfiguration");
            FirePropertyChanged("DisplayID");
        }
   }


   public class LaneConfiguration : PolygonConfiguration
   {
       public override string DisplayID
       {
          get
          {
              return IsLaneGroup?string.Format("Lanes {0} - {1}", ID, ID + LaneCount - 1):                                  string.Format("Lane {0}", ID);
          }
       }
   }
  • 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-06-05T20:47:03+00:00Added an answer on June 5, 2026 at 8:47 pm

    I created a shorter example of this and reposted and got an answer.

    I thought I only needed INotifyPropertyChanged on the code-behind. I actually needed it in my data object LaneConfiguration class as well. I should have paid closer attention to Ali Adl’s comment. It would have saved me a day of frustration..

    Thanks Ali Adl and Tim for your helpful answers !!

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

Sidebar

Related Questions

I'm having a problem binding the jQueryUI combobox value to a computed observable in
I am having an issue with two-way binding the SelectedItem of the ListPicker In
I am having a problem using two way binding with a listpicker. I am
I am having a problem using two way binding with a listpicker. I am
I am having a problem with binding values in my ActionScript components. I basically
I am having trouble with the checked binding: clicking on the checkbox doesn't update
I'm having a problem with a piece of code that's starting to drive me
i having this problem randomly and i able to add/delete/update using the WCFServiceClient and
I'm having a problem with knockout checked binding. It seems that change event at
I am having trouble binding a Command that is generated up the UI tree

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.