Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. How to keep two Combo Boxes in sync with WPF [modified]

How to keep two Combo Boxes in sync with WPF [modified]

Scheduled Pinned Locked Moved WPF
wpfarchitecturecsharpdesignregex
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 2970611
    wrote on last edited by
    #1

    Hi I have a four combo boxes, along with one text box and all 5 controls. The principle is that if the user selects an item from the first combo box, this selected item then gets reflected in the text box and the four other combo boxes. Whilst this action is working, if the user then selects a new item from the first combo box, say the next item down in the list, the new item is not showing in the other controls. The previous item is still there and hasn't been refreshed. Checking the class object, when first used, the object is being set with the value, but when selecting a new value from the combo box, this new value is not being passed on or up dates the object. I am using INotifyPropertyChanged! I have set IsSyncronizeWithCurrentItem ="true" on all of the combo boxes, but this isn't working. How do you very simply, keep all these controls in sync? Code is being built using MVVM design pattern.

    modified on Monday, June 27, 2011 3:53 PM

    S M 2 Replies Last reply
    0
    • U User 2970611

      Hi I have a four combo boxes, along with one text box and all 5 controls. The principle is that if the user selects an item from the first combo box, this selected item then gets reflected in the text box and the four other combo boxes. Whilst this action is working, if the user then selects a new item from the first combo box, say the next item down in the list, the new item is not showing in the other controls. The previous item is still there and hasn't been refreshed. Checking the class object, when first used, the object is being set with the value, but when selecting a new value from the combo box, this new value is not being passed on or up dates the object. I am using INotifyPropertyChanged! I have set IsSyncronizeWithCurrentItem ="true" on all of the combo boxes, but this isn't working. How do you very simply, keep all these controls in sync? Code is being built using MVVM design pattern.

      modified on Monday, June 27, 2011 3:53 PM

      S Offline
      S Offline
      SledgeHammer01
      wrote on last edited by
      #2

      IsSynchronizedWithCurrentItem does work. I've used it myself. I won't ask why you have 4 ComboBoxes and a TextBox all showing the same exact info :), but if its not working, you're likely doing something wrong, so post your code.

      1 Reply Last reply
      0
      • U User 2970611

        Hi I have a four combo boxes, along with one text box and all 5 controls. The principle is that if the user selects an item from the first combo box, this selected item then gets reflected in the text box and the four other combo boxes. Whilst this action is working, if the user then selects a new item from the first combo box, say the next item down in the list, the new item is not showing in the other controls. The previous item is still there and hasn't been refreshed. Checking the class object, when first used, the object is being set with the value, but when selecting a new value from the combo box, this new value is not being passed on or up dates the object. I am using INotifyPropertyChanged! I have set IsSyncronizeWithCurrentItem ="true" on all of the combo boxes, but this isn't working. How do you very simply, keep all these controls in sync? Code is being built using MVVM design pattern.

        modified on Monday, June 27, 2011 3:53 PM

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Check that the binding of the selecteditem in the combobox is Mode="TwoWay".

        Never underestimate the power of human stupidity RAH

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups