G
Guest
Hi,
I have a custom collection that is basically a wrapper of an List<T>
collection. I want to expose the IEnumerable<T> interface of the collection
to the world, so on my custom collection, I implement both
IEnumerable/IEnumerator, and IEnumerable<T>/IEnumerator<T>. My code for
those interfaces just calls off to the internal collections's methods, such as
IEnumerator IEnumerable.GetEnumerator()
{
return myinternalList.GetEnumerator();
}
I am trying to bind my custom list to a control that can bind to a
collection that implements IEnumerable and/or IList (I expose the IList
interface for the internal collection in a similar way).
The problem is, everytime I execute something like
myControl.DataSource = myCustomCollection
I get a NullReferenceException. I can't really tell where it's coming from,
or what is null. Neither my custom collection nor the internal IList
collection are null.
Any ideas?
Jeff
I have a custom collection that is basically a wrapper of an List<T>
collection. I want to expose the IEnumerable<T> interface of the collection
to the world, so on my custom collection, I implement both
IEnumerable/IEnumerator, and IEnumerable<T>/IEnumerator<T>. My code for
those interfaces just calls off to the internal collections's methods, such as
IEnumerator IEnumerable.GetEnumerator()
{
return myinternalList.GetEnumerator();
}
I am trying to bind my custom list to a control that can bind to a
collection that implements IEnumerable and/or IList (I expose the IList
interface for the internal collection in a similar way).
The problem is, everytime I execute something like
myControl.DataSource = myCustomCollection
I get a NullReferenceException. I can't really tell where it's coming from,
or what is null. Neither my custom collection nor the internal IList
collection are null.
Any ideas?
Jeff