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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:56:38+00:00 2026-06-07T22:56:38+00:00

I have been tasked with adding a combobox to an already existing WPF form.

  • 0

I have been tasked with adding a combobox to an already existing WPF form. I have never worked with WPF and I am pretty lost, specifically when it comes to binding and using the ObservableCollection property. All the examples are completely different form the way I was told to do it.

I originally had my combobox set up like this:

<ComboBox Name="GroupComboBox" Width="132" Height="22" Grid.Column="0" Grid.Row="3" Margin="0,30" VerticalAlignment="Top" >         
    <ComboBoxItem Content="Data Warehouse"></ComboBoxItem>
    <ComboBoxItem Content="KPI"></ComboBoxItem>
    <ComboBoxItem Content="Failures"></ComboBoxItem>
    <ComboBoxItem Content="All Groups"></ComboBoxItem>            
</ComboBox>

Which worked great. This was when I was told I had to get rid of all the ComboBoxItem Contents and bind the combo box to ObservableCollectionGroups and ObservableCollectionSelectedGroups and to do so all I had to do was add this to the ViewModel class:

 public ObservableCollection<string> Groups { get; set; }      

 public ObservableCollection<string> SelectedGroups { get; set; }

OK, so I added the above to the view model class like this:

public class ClioViewModel : INotifyPropertyChanged
{
    public ObservableCollection<string> Groups { get; set; }      

    public ObservableCollection<string> SelectedGroups { get; set; }
}

(there’s a ton of other stuff already in this class as well but in the interest of time and space I did not post it. If needed I will gladly add more if requested)

I then changed my xaml to look like this:

<ComboBox Name="GroupComboBox" ItemsSource="{Binding Groups}" SelectedItem=" Binding  SelectedGroups, Mode=TwoWay}" Width="132" Height="22" Grid.Column="0" Grid.Row="3" Margin="0,30" VerticalAlignment="Top" >                         
</ComboBox>    

which didn’t work. Of course it didn’t work! I haven’t listed any of the items I want inside of my comboBox! The question is, if they do not belong inside of the comboBox and they are not put in the Group/Selected group properties, where in the heck do they go? None of the multitude of combobox binding examples I have seen look anything like what I am being told to do.

If someone could enlighten me on what I am missing, I would really appreciate it.

  • 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-07T22:56:39+00:00Added an answer on June 7, 2026 at 10:56 pm

    you need to add the values in your Group collection somewhere (in the initializer or the class constructor I’d say):

    Groups.Add("Data Warehouse");
    Groups.Add("Data KPI");
    Groups.Add("Data Failures");
    Groups.Add("Data All Groups");
    

    frankly, I do not see the point of doing this in this case, but It might have something to do with the rest of your code.

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

Sidebar

Related Questions

At work I have been tasked with adding additional functionality to an existing MVC
I've been tasked with adding functionality to an existing ASP.net Form Application. Users are
I have a SSRS report that I have been tasked with adding a second
I'm developing a client-server application and have been tasked with adding support for running
I have been tasked to create a form designer application in Windows Forms. The
I have been tasked with creating an API for retrieving and adding content to
I have been tasked to replace the hardware an existing Apache/Tomcat/MySQL application is running.
I have been tasked with optimizing a marketing landing page for speed. It already
As part of a course assignment, we have been tasked with adding an extra
I have been tasked with fixing bugs and adding new features to a website

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.