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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:00:35+00:00 2026-05-13T08:00:35+00:00

Question: How do you set the binding for a ComboBox’s Selected items to one

  • 0

Question: How do you set the binding for a ComboBox’s Selected items to one property and the items list to a different property?


Info:

I have an inventory program I’m working on for my company which is aimed mostly at the people who receive shipments as they come in. I have things set up so that there is a list of shipments on one side of the screen. when they select one of these all the information on the shipment is displayed so it can be edited. one bit of information is the person who received the shipment. I want it so that when they click the shipment, obviously the user who received the shipment is the one who pops up in the combo box. but i want the combo box to contain the list of all the other users.

This wouldn’t be to hard if it weren’t for the fact that I’m pulling the list of users from a database. the list box has a data template for pulling the proper information out of the list of user data types. what I’ve tried so far is to have a collection view in the viewmodel that the combo box binds to for its list, then a seperate property which is a single user instance that comes with the shipment data type.

I’m programing in Visual Basic and XAML according to the M-V-VM programing model.

  • 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-13T08:00:36+00:00Added an answer on May 13, 2026 at 8:00 am

    There is nothing wrong with your approach. The ViewModel can expose a collection of types from the db and a separate property bound to the selected item, something like:

    public ObservableCollection<Shipment> AllShipments { get; private set; }
    public Shipment SelectedShipment { get; set; }
    
    // Constructor
    public MyViewModel()
    {
        AllShipments = ReadFromDb();
    }
    

    In terms of the combobox being empty

    • Have a look in the output window in VS when you start your app – is there a line complaining about a Binding failing?
    • Double-check the spellings of your properties against your xaml Binding
    • Put a breakpoint on the AllShipments getter to make sure it is not null when the View instantiates the binding. If you read the db in the VM’s constructor (as above) then this will be OK.

    Also – if you want the combo-box to display the User from the shipment object, then remember to ensure your VM (or its base) implements INotifyPropertyChanged, and raises a PropertyChanged event in the SelectedShipment setter – this will propagate the change through to the View via the DataBinding…

    hope this helps 🙂

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

Sidebar

Ask A Question

Stats

  • Questions 356k
  • Answers 356k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer After you create a SplitView project, open up the RootViewController.m… May 14, 2026 at 8:49 am
  • Editorial Team
    Editorial Team added an answer After a long research and test executions i came to… May 14, 2026 at 8:49 am
  • Editorial Team
    Editorial Team added an answer Try putting your call to goToView in viewDidAppear instead of… May 14, 2026 at 8:49 am

Related Questions

I have a situation where I need to access an object that has been
Ok, so having given up on getting the built in .NET configuration system to
XAML allows you to specify an attribute value using a string that contains curly
How can I bind arguments to a Python function so that I can call
I have a DataGridView with its datasource set to a generic list of custom

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.