SL Turn Hierarchical Data into Flat Data to Populate a DataGrid
I have a list of Object's, each Object has a Children property which is a list of Object's, which in turn has a Children property which 开发者_JAVA技巧is a list of Object's ... the same thing 4 layers deep. I'm trying to pull out every instance of Object inside the entire hierarchy. At each level down the hierarchy it's still the same type of Object.
My attempts have involved using LINQ but so far no dice.
Does anyone have another angle to approach this?
If I am following your line of logic correctly I think what you are looking for is something like what this guy wanted ...
LINQ: How to convert the nested hierarchical object to flatten object
Sounds like you are trying to flatten the object which you can do through a recursive function.
精彩评论