Hi,
I'm using the XamDataGrid with hierarchical data as datasource so i get this output:
Parent1 Col1 | P1 Col2 | P1 Col 3
+ Child1 Col 1| C1 Col 2 | C1 Col 3
+ Child2 Col 1| C2 Col 2 | C2 Col 3
Now i'm looking for a way to display parent and child in the same row to see something like this:
Parent1 Col1 | P1 Col2 | P1 Col 3 | C1 Col 1| C1 Col 2 | C1 Col 3
Parent1 Col1 | P1 Col2 | P1 Col 3 | C2 Col 1| C2 Col 2 | C2 Col 3
Is there a way to achieve this without manually combine parent and child in one datatype?
Thanks for your help.
- Bastian
Would be nice if i could just define it that same as I would a heir grid and then just put placeholders in for the children's columns.
Yep, looking for the same feature. Children in a collection and want to flatten the record/grid into a single row containing parent properties and multiple children's properties.
Hi Alan,
this solution works perfect for me.
Even though my problem is solved, an automatic solution which combines existing FiledLayouts for parent and child in one row would be nice.
Thanks
Bastian
Bastian,
If your child has a reference back to the parent and you have a list of all of the child object, you could bind the XamDataGrid to the complete list of children and then use UnboundField objects for the parent fields. This can be done by setting the BindingPath property of the UnboundField to something like "Parent.Col1" where Parent is the property of the child that exposes the parent and Col1 is the property on the parent that you wish to bind to.
Let me know if you have any questions with this matter.
Hi Francis,
thanks for logging the Feature Request.
In our case this approach won't work because we need the filtering and sorting of the grid for all field's. So I think I'm goint to to combine the parent and the child to an anonymous type in my query and wait for the result of the Feature Request.
Thanks,Bastian