Make a DataBindable object

G

Guest

Hi,

I'm struggling to find a way to make a single object databindable, i.e. show
up as a possible data source in the databindings dropdown in design time.

I have been able to create something that's close, by implementing
ITypedList and IListSource, but what I really need is to be able to bind to a
dynamicly generated list of properties, and not to a predefined System.Type.

As I see it, Microsoft have done it when binding to a DataSet... If all
databinding occurs through reflection, and binds to properties, how come I
can bind to columns on data tables? The columns are NOT properties on the
table, but rather an internal collection of DataColumn objects.

How can I implement a custom object that hosts something similar to a
databindable DataColumn collection?

Thanks in advance,

Danny van Kasteel
 
G

Guest

Thanks for your reply, but I'm not entirely sure that it is what I need.

If I'm not mistaken, implementing IList (or ITypedList) will result in a
collection-type object that holds MULTIPLE instances of ONE TYPE, through
which a user can scroll.

What I need, however, is ONE instance of ANY type that a user can bind to.
Furthermore, the type I'm referring to, isn't really a type. It's a
dictionary of properties, retrieved from an XML format.

What Microsoft has accomplished with datatables, is that each column of type
DataColumn is exposed as a property that can be used in data binding. So how
is this mapping of items in a collection to databindable properties achieved?

Thanks in advance,

Danny van Kasteel
 

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