View Full Version : .net databinding to an interface

11-11-2005, 04:49 PM
I know most use PHP around here, This is probably a real simple question but I can't pin point an answer.

I have two different objects that Implement the same interface, I have a collection or arraylist of those objects and I want to bind them to a datasource. This seems to work most of the time but from time to time I get some weird behavior, like it only binding to the first object type in the Array?

This MSDN (http://msdn2.microsoft.com/en-us/library/41e17s4b.aspx) article has a little information but I still am seeing differing things.

Here is the part that confuses me....

A class that implements the IList interface could be an Array, ArrayList, or CollectionBase. These are indexed lists of items of type Object. These lists must contain homogenous types, because the first item of the index determines the type. IList would be available for binding only at run time.

So can I have more than 1 object type that implements the same interface add them to something that implements the Ilist interface and bind it to a complex datasource, ie. a datagrid?

Any help would be appreciated...