Interesting...I happen to be trying to do the same thing. I implemented
ICustomTypeDescriptor for my collection (which would return property
descriptors for the items in the collection, when asked), but methods in the
interface were never called (placed breaks). So the DataGrid still only
displays properties in the base class...the derived class properties still
aren't discovered.
Precisely where would one implement ICustomTypeDescriptor if not on the
custom collection? Implementing it in the base class of the bound object
won't (shouldn't) work because the base class has no knowledge of the
derived properties. Implementing it in the derived class won't work because
the DataGrid isn't accessing the derived class. So I'm missing something
here...
Odd that DataGrid isn't accessing derived class properties when the type
given over from the collection is the derived type. I can see not caring
about derived types if the DataGrid were bound to a base class...but not
when bound to a derived class, one (me, anyway) would expect the derived
type's properties to be accessible.
I see, Sijin, that you post a lot of responses in this newsgroup. Thanks for
your efforts. :)
-Kenn
> This is currently not supported with datagrid as it only scans
> properties one level deep. One workaround is to implement a
[quoted text clipped - 166 lines]
> > End Property
> > End Class
Sijin Joseph - 18 Oct 2004 04:56 GMT
Thanks Kenn, it's a great learning experience for me too. :)
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
> Interesting...I happen to be trying to do the same thing. I implemented
> ICustomTypeDescriptor for my collection (which would return property
[quoted text clipped - 190 lines]
>>>End Property
>>>End Class