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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:23:53+00:00 2026-05-22T00:23:53+00:00

I have a ComboBox with its Items property bound to a collection of objects.

  • 0

I have a ComboBox with its Items property bound to a collection of objects. I also have SelectedItem property bound to the entire collection, with a ValueConverter designed to examine the elements in the collection and return the 1 item to be selected. This part works.

What doesn’t work is when the user makes a selection change on the ComboBox, the ConvertBack(...) method of the ValueConverter is not being called. I need ConvertBack(...) called because I need to take the user’s selection, re-examine the collection, and edit the old selected item and newly selected item appropriately.

I know this approach is a awkward, but it’s the way it is. Here’s the relevant code:

ComboBox:

<ComboBox ItemsSource="{Binding}" SelectedItem="{Binding Path=., Converter={StaticResource ResourceKey=DataInputAssetChoiceSelectedItemConverter}}" />

ValueConverter:

public class DataInputAssetChoiceSelectedItemConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value != null)
        {
            foreach (CustomObject Choice in (Collection<CustomObject>)value)
            {
                if (Choice.IsSelected)
                {
                    return Choice;
                }
            }
            return ((Collection<CustomObject>)value).First();
        }
        return null;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {   //breakpoint...execution never gets here!
        return null;
    }
}

So why doesn’t ConvertBack(...) ever get called? Is it just something I’m misunderstanding about ComboBox? I’ve tried this approach using SelectedItem, SelectedValue, SelectedIndex, and have tried messing with UpdateSourceTrigger, various binding modes, DataTriggers, and can never seem to get ConvertBack(...) to be called. Is using the SelectionChanged event the only option? If so, why?

  • 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-22T00:23:53+00:00Added an answer on May 22, 2026 at 12:23 am

    You are not binding to a property, so the Binding can’t set anything. You are binding directly to the DataContext object, and the Binding won’t update that.

    If you had {Binding Path=SomeProperty, Converter=...} then the ConvertBack would be called. As it stands though, it won’t be called.

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

Sidebar

Related Questions

To clarify I have a combobox with an observable collection bound to its itemsource
I have a ComboBox and its items source is an SQL table. I would
I have a ComboBox that has its ItemsSource bound to a static List<CustomSettings> of
I'm working on a ComboBox that has to have a CheckBox on its items.
I have a ComboBox with its DataSource set to an instance of a DataTable.
I have a user control with a combobox, and so I can edit its
I have a combobox from which i need to programmatically disable items depending on
I have a data-bound combobox on a Windows form. When I select an item,
i have a combobox and its on a narrow part of a webpage. below
The ComboBox Items collection is an ObjectCollection, so of course you can store anything

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.