Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to allow binding to type complex property (example is binding grid to collection<invoices>, and displaying properties from Invoice.Customer.Name). I think it can be done by implementing ITypedList on my collection, but I just don't understand what kind of information do I need to pass - do I need to make some custom property descriptors, or? I want this solution to be generic, not specific to Customer type.

My question is what do I need to return in GetItemProperties, so grid control will be able to bind to child entity property?

Any help is appreciated.
Thanks,
Goran
Posted
Updated 23-Mar-11 3:24am
v2

1 solution

Have you looked at the MSDN page for ITypedList[^]?

The example given looks pretty complete.
 
Share this answer
 
Comments
Goran _ 23-Mar-11 9:21am    
Yes, I have, but it is still handling only first level properties, it doesn't handle child propertied. If you see my requirement, it is not just implementing ITypedList, but implementing it in a way so grid control (ex DataGridView) will know how to bind to child properties (example "Customer.Name")
Henry Minute 23-Mar-11 12:12pm    
Take a look at this blog ->http://blogs.msdn.com/b/msdnts/archive/2007/01/19/how-to-bind-a-datagridview-column-to-a-second-level-property-of-a-data-source.aspx.

From it's title, it sounds like it might do what you want.
Goran _ 24-Mar-11 15:43pm    
Thanks Henry, this was a good start.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900