Hello my question is very simple, I would like to bind my object collection to an ultracomboeditor
here is my code
Country country; List<Country> countryList = new List<Country>(4); country = new Country(); country.Name = "Argentina"; countryList.Add(country); country = new Country(); country.Name = "Chile"; countryList.Add(country); country = new Country(); country.Name = "Egypt"; countryList.Add(country); country = new Country(); country.Name = "Mexico"; countryList.Add(country);
countryCombo.DisplayMember = "Name"; countryCombo.DataSource = countryList
This code works fine with UltraCombo but not UltraComboEditor ... Can you tell me why. I am using Infragistics 7.3
Do you have the latest Hot Fix? This sounds like a bug that may already have been fixed.
You might also need to set the ValueMember, too.
Ok thanks Mike it is working now
I have an other probleme with UltraComboEditor,
I want to bind the selected Country object with the property of an object of my Model so that whenever the userpick another country in the list the model is automaticallty updated
with a classic combo I do it like this :
comboBox.DataBindings.Add("SelectedItem", Project, "Country", false, DataSourceUpdateMode.OnPropertyChanged);
The SelectedItem is a country in that case as the dataSource of my comboBox is a List<Country>
The problem with infragisitcs ultraComboeditor is that SelectedItem is not a Country but a Infragistics.Win.ValueListItemAnd even if SelectedItem.ListObject is of Country type I can't bind it because it is read only ...
Can I do what I want with UltraComboEditor or do I have to go back to classic winform combo ?
I beleive your question is answered here:
Binding on objects - Infragistics Forums