Databinding combobox to custom object - selected index / item not updating object property

Posted on 2008-11-18
Last Modified: 2012-05-05
I'm pulling my hair out trying to bind a custom object property to a combobox so that when the combox selecteditem is changed the value in the custom outject is updated  to reflect this change and the onPropertyChanged event occurs  - sorry if this is a really simple request:




public class TeleconferencingInfo : INotifyPropertyChanged

private string test;

/// <summary>


/// </summary>

public string Test




return test;




test = value;




private void onPropertyChanged(string propertyName)


if (PropertyChanged == null)


PropertyChanged(this, new PropertyChangedEventArgs(propertyName));


public event PropertyChangedEventHandler PropertyChanged;




attempt at databinding:


TeleconferencingInfo _TeleconferencingInfo = new TeleconferencingInfo();


comboBox1.DataBindings.Add("SelectedValue", _TeleconferencingInfo, "Test");

 comboBox - items - strings "1", "2" "3" etc

any help much appreciated.


Question by:mit99mh
    LVL 8

    Expert Comment

    Is the control set to "AutoPostBack" = true?
    LVL 22

    Expert Comment

    you might want to give you private test an instantiating value like null or string.empty.

    Accepted Solution

    I found a solution:

    BindingSource teleconferencingBindingSource = new BindingSource();
    teleconferencingBindingSource.DataSource = _TeleconferencingInfo;

    myComboBox.DataBindings.Add("SelectedValue", teleconferencingBindingSource, "Test", true, DataSourceUpdateMode.OnPropertyChanged);

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now