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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:26:54+00:00 2026-05-13T17:26:54+00:00

The Wpf combo box allows editing, and this is fine if all your combo

  • 0

The Wpf combo box allows editing, and this is fine if all your combo box items are strings, or have a ToString() method defined on them.

When you select an item, it is displayed as Text, it does not use a DataTemplate, it just calls ToString() on the item that is selected.

I get a list of items in my combo drop down that are formatted using my item template, when i select one i get the name of the object i.e. MyNamespace.MyObjectName

Some solutions have been

  • use ValuePath to bind to a property
    on the object, but if you require
    your display to be more than one of
    these, bad luck.
  • implement the ToString() method on
    your object

is there another way around?

  • 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-13T17:26:54+00:00Added an answer on May 13, 2026 at 5:26 pm

    You can do this entirely within Xaml

    <ComboBox IsTextSearchEnabled="True" IsEditable="True"
            ItemsSource="{Binding MyObjectCollection}"
            TextSearch.TextPath="MyObjectName">
        <ComboBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding MyObjectName}" />
            </DataTemplate>
         </ComboBox.ItemTemplate>
    </ComboBox>
    

    The upside is that you can define and change this however you want in your XAML without any code-behind. You bind the ItemsSource to your collection of objects, and then you set the path on which to base your search to TextSearch.TextPath. Then, within you custom ItemTemplate you can bind the TextBlock to something else outside of the object’s ToString method.

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

Sidebar

Related Questions

In my WPF application, I have an editable combo box with 150px fixed width.
I have a WPF application that allows users to create questions of all different
I have a combo box in my WPF project and I would like to
I have a wpf application which has combo box and multiple text boxes. On
I have a custom control in WPF that simply holds a combo box (however
I have an editable combo box in wpf-mvvm application. I would like to add
I have below combo box in mvvm-wpf application. I need to implement Text search
I have a wpf-mvvm application. In that I have follwoing... <Combo box> item 1
I have created combo box that I would like to load with all of
I have a combo box inside a list view. And different items (rows) in

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.