Laughing.John
New member
- Joined
- Aug 25, 2006
- Messages
- 3
- Programming Experience
- 10+
I'm a bit confused about creating my own objects for complex databinding.
I understand the you can use a collection of objects or roll your own collection by inheriting from IBindingList.
But suppose I don't have an object and I want to bind to a set of rows with a set of columns that are defined at run-time.
Basically it is the same functionality as a datatable with its datarows. What interfaces do you need to support to roll your own datatable ?
I understand that the Table would use IBindingList or IList, but what about the datarow ? How does a bound control know where to get the values and names of the columns ? Using Reflector I can't work out which interface DataRow supports that allow this ?
Can anyone help ?
The structure looks like this:
Table
Rows
Columns
And it's the collection of columns I don't know how to create. Does this need to also support and IBindingList ? And what sort of interface do the actual fields need to support ?
I understand the you can use a collection of objects or roll your own collection by inheriting from IBindingList.
But suppose I don't have an object and I want to bind to a set of rows with a set of columns that are defined at run-time.
Basically it is the same functionality as a datatable with its datarows. What interfaces do you need to support to roll your own datatable ?
I understand that the Table would use IBindingList or IList, but what about the datarow ? How does a bound control know where to get the values and names of the columns ? Using Reflector I can't work out which interface DataRow supports that allow this ?
Can anyone help ?
The structure looks like this:
Table
Rows
Columns
And it's the collection of columns I don't know how to create. Does this need to also support and IBindingList ? And what sort of interface do the actual fields need to support ?