Can't get ITypedList to work with custom collection when binding

J

Joe Jax

I'm building my own version of a readonly DataTable, which needs to bind to
various controls. My data table class has two main collections
(CollectionBase instances): one of columns, one of rows, where each row has
a collection of column values. I have implemented the ITypedList interface
on my rows collection, but when I bind the collection to a grid (asp.net
datagrid) it tells me that the specified properties don't exist. There is no
indication that the ITypedList.GetItemProperties() method is being invoked
so the binding process seems to be ignoring my custom property descriptors.
Any suggestions?
 
J

Joe Jax

Joe Jax said:
I'm building my own version of a readonly DataTable, which needs to bind
to various controls. My data table class has two main collections
(CollectionBase instances): one of columns, one of rows, where each row
has a collection of column values. I have implemented the ITypedList
interface on my rows collection, but when I bind the collection to a grid
(asp.net datagrid) it tells me that the specified properties don't exist.
There is no indication that the ITypedList.GetItemProperties() method is
being invoked so the binding process seems to be ignoring my custom
property descriptors. Any suggestions?

Solution for anyone with the same problem in the future...

Additionally implement the ICustomTypeDescriptor on the row class. Use .NET
Reflector on the DataView and DataRowView classes for an example of how to
do this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top