Hi,
I have a nested list of objects. I need the data to be displayed in hierarchial manner.
I have a list of objects, lets say list A, which has IList(of B) (Generic List) as one of its properties and IList(of B) contains IList (of C). What should i do to display the data in hierarchial way ?
Couple of tradeoffs that i have is, IList(of B) and IList(of C) might not have the same columns and i'm trying to use BindingList(of A). Still i get only parent list and not the child ones'
Any help is appreciated!
Thanks.,
If you have a list of A and one of the properties of the A object is a list of some other object, then you don't have to do anything. SImply bind the grid to the list of A objects and the B object list will display as a child band.
I would recommend using BindingList rather than List, though. List will not allow you to add new rows and it will not update the grid when the data changes.
Also, you might have to use List rather than just IList. It think the BindingManager might not recognize IList as a valid chaptered property.
OK, it works but up to level 2, I mean two bands are displayed.
How to make it work with any depth?
I understand Mike. I'm using NHibernate to get my object collection and it supports IList and not List.
Now if i bind my List(Of A) it is not showing in hierarchy. May be becoz, it is an IList(Of B) and IList(Of C) inside List(Of A).
Is there any other workaround?