I have the following classes/interfaces. I’m getting an ArgumentException saying “Complex DataBinding accepts as a data source either an IList or an IListSource”. But, I am setting it to an IList. What am I doing wrong?
public interface IOriginList : IList<IOriginEntry>
{
...
}
public class OriginList : Interfaces.IOriginList
{
...
}
// Binding code
IList<IOriginEntry> originList = new OriginList();
cboOrigin.DataSource = originList;
I don’t believe you can bind to a generic IList<>, only a non-generic IList.
Try this:
* Edit *
Actually, the problem might be that the IList is of an interface type? Nowhere is IOriginEntry set to a concrete object, and you can’t bind the combo box item to an interface.
You could also try this: