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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:26:48+00:00 2026-05-29T09:26:48+00:00

I’m not sure if this is possible or not. I have created a ComboBox

  • 0

I’m not sure if this is possible or not. I have created a ComboBox like this…

<ComboBox Name="testType"
          Margin="0,5,0,0"
          IsTextSearchEnabled="True"
          DisplayMemberPath="Description"
          SelectedValue="{Binding MyClass.Id, Mode=TwoWay}"
          SelectedValuePath="Id"/>

with code behind that loads up the available options…

        DataTable testCatList = TestTypeBase.GetAll();
        testType.ItemsSource = testCatList.DefaultView;

so that it properly displays all the items in MyClass. When the user makes a selection, the Id field in MyClass gets updated as intended. Great.

Here’s my problem: My testCatList contains both the Id and the Description for each of the rows, and I’d like both of those fields to be bound to the current MyClass instance. So here’s what I tried:

<ComboBox Name="testType"
          Margin="0,5,0,0"
          IsTextSearchEnabled="True"
          DisplayMemberPath="Description">
    <ComboBox.SelectedValue>
        <MultiBinding Converter="{???}">
            <Binding Path="MyClass.Id" Mode="TwoWay"/>
            <Binding Path="MyClass.Description" Mode="TwoWay"/>
        </MultiBinding>
    </ComboBox.SelectedValue>
</ComboBox>

Here, I’d like to have MyClass.Id set to the selected Id and the MyClass.Description set to the selected Description. As you can see, I have removed the SelectedValuePath because I don’t just want the Id any more. But I don’t know what to use for the Converter (see the question marks above).

Any ideas, oh experts of StackOverflow? Thanks.

  • 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-29T09:26:48+00:00Added an answer on May 29, 2026 at 9:26 am

    If I understood correctly try using SelectedItemproperty instead of SelectedValue.
    In that way you will get the selected MyClass instance and of course all of its properties.

    SelectedItem="{Binding CurrentSelectedMyClassItem}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have just tried to save a simple *.rtf file with some websites and

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.