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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:03:46+00:00 2026-05-15T00:03:46+00:00

I have been defined some ComboBox element: <ComboBox Height=27 Margin=124,0,30,116 Name=cbProductDefaultVatRate VerticalAlignment=Bottom ItemsSource={Binding}> <ComboBox.ItemTemplate>

  • 0

I have been defined some ComboBox element:

<ComboBox Height="27" Margin="124,0,30,116" Name="cbProductDefaultVatRate" VerticalAlignment="Bottom" ItemsSource="{Binding}">
    <ComboBox.ItemTemplate>
        <DataTemplate>
            <Label Height="26" Content="{Binding Path=Value}"/>
        </DataTemplate>
    </ComboBox.ItemTemplate>
</ComboBox>

and set the data source for component items of VatRate type:

private void ShowAllVatRates()
{
    cbProductDefaultVatRate.Items.Clear();
    cbProductDefaultVatRate.ItemsSource = new VatRateRepository().GetAll();
}

VatRate object has a property:

private Product SelectedProduct
{
    get; set;
}

where is a product contains VatRate as well:

SelectedProduct.DefaultVatRate

How to set SelectedItem property of ComboBox to SelectedProduct.DefaultVatRate?

// does not work!!!
cbProductDefaultVatRate.SelectedItem = SelectedProduct.DefaultVatRate;

Thank you for answers!

  • 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-15T00:03:47+00:00Added an answer on May 15, 2026 at 12:03 am

    You need to make sure that the actual object instance behind SelectedProduct.DefaultVatRate is the same instance as the one that is part of the list returned by new VatRateRepository().GetAll() or object.Equals() must return true for the two instances.

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

Sidebar

Related Questions

I have been given some file name which can be like <filename>YYYYMMDD<fileextension> some valid
I am rejigging some urls that have been defined in javascript: var x =
I have been defined a bind function , b <- function(f,...) function(x) f(x, ...)
I keep getting errors that my functions have been defined multiple times. Of course
I have been trying to assign value to an object array that is defined
I have an ItemsControl with a DataTemplate that has been defined. My ItemsControl definition
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
I have been assigned to work on some legacy C++ code in MFC. One
I have been playing around with Scala parser combinators for some time now, and
I have been asked to make some customisation changes to our Dynamics CRM 4.0

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.