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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:10:04+00:00 2026-05-18T11:10:04+00:00

I have three ComboBoxes such that C’s items list is dependent on the selected

  • 0

I have three ComboBoxes such that C’s items list is dependent on the selected item in B and B’s items list is dependent on the selected item in A. I have ObservableCollections of particular classes for the ItemsSource on each ComboBox, and I want the Name property of the selected item to be pushed to a property in another class. For example:

ObservableCollection<AClass> Items
=> ItemsSource of cbo_A ComboBox

And selectedInstanceOfAClass.Name should be pushed to Data.AClassName property. The problem I have is that when I choose a value in the A ComboBox the first time, the B ComboBox gets the appropriate items based on the selected item in A, as expected. Same for when I select an item in B for the first time–C gets the right items. However, when I choose a different value in A, the items in B get updated but the selected value of B stays the same, and when I try to select a new value in B from its new items, the selection doesn’t change–it stays the same selected value as what I initially selected in B.

Here’s the XAML I have right now:

<ComboBox x:Name="cbo_A"
    ItemsSource="{Binding Path=Lists.AItems, Mode=OneWay}"
    DisplayMemberPath="Name" SelectedValuePath="Name"
    SelectedValue="{Binding Path=Data.AClassName, ValidatesOnDataErrors=True,
        Mode=OneWayToSource}" />

<ComboBox x:Name="cbo_B"
    ItemsSource="{Binding ElementName=cbo_A, Path=SelectedItem.BItems, Mode=OneWay}"
    SelectedValuePath="Name" DisplayMemberPath="Name"
    SelectedValue="{Binding Path=Data.BClassName, ValidatesOnDataErrors=True,
        Mode=OneWayToSource}"/>

<ComboBox x:Name="cbo_C"
    ItemsSource="{Binding ElementName=cbo_B, Path=SelectedItem.CItems, Mode=OneWay}"
    SelectedValuePath="Name" DisplayMemberPath="Name"
    SelectedValue="{Binding Path=Data.CClassName, Mode=OneWayToSource,
        ValidatesOnDataErrors=True}" />

What is causing the weird behavior with the selected value not updating even when I explicitly click the ComboBox and try to change the value?

Edit: when debugging and I had a SelectionChanged handler on cbo_A and another on cbo_B, I entered the cbo_B handler before the cbo_A one, so the selected item from B’s perspective was still the old item, because A had not been updated yet. :/

Edit 2: if I flip the order of my ComboBoxes in XAML, suggested by this question, such that C comes before B comes before A, I enter A’s handler first. When I then enter the handler for cbo_B, the SelectedItem property shows the old value (previously selected, before I chose a new value in cbo_A), even though I clicked a value from the new list of items showing up in the ComboBox.

Edit 3: I’m trying a version of this answer and getting the same problem: I see new values in ComboBox B upon changing the selected value of ComboBox A, but I cannot change the selected value in B after I’ve already set it once. I’m beginning to think I’ve got something else going awry.

  • 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-18T11:10:05+00:00Added an answer on May 18, 2026 at 11:10 am

    Wow. So, don’t go quickly implementing a bunch of IEquatable<T> Equals methods for new classes, because you may end up doing what I did:

    if (ReferenceEquals(this, other))
    {
        return false;  // Say what??
    }
    

    Sigh. I got my ComboBoxes to work by:

    • Correcting my BClass.Equals(BClass other) method;
    • Using this answer about having another view model class with different properties like SelectedAItem and AItems; and
    • Using this answer about putting my XAML declarations in a different order so cbo_C comes before cbo_B and cbo_B comes before cbo_A.

    I may try simplifying things and see what parts are absolutely necessary for my ComboBoxes.

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

Sidebar

Related Questions

I have three unordered lists that have been created as Scriptaculous Sortables so that
I have three (C++) classes: Player, Hand, and Card. Player has a member, hand,
I have a list of Customer objects that I need to have selectable from
I was just writing a windows application that populates three comboboxes from the same
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three tables tag , page , pagetag With the data below page
I have three models: class ReleaseItem < ActiveRecord::Base has_many :pack_release_items has_one :pack, :through =>
I have three divs : <div id=login /> <div id=content /> <div id=menu />
I have three TextBox controls on the page <asp:TextBox ID=TextBox1 runat=server AutoPostBack=True OnTextChanged=TextBox_TextChanged TabIndex=1>
I have three tables in the many-to-many format. I.e, table A, B, and AB

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.