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
Hi Bastian,
I have logged a Feature Request for this (FR12954) with Product Mangement. This question came up in one of my prior support cases, and the suggestion I got from our developers was the following.
Try setting the Field’s IsExpandable property to false and then set its Field.Settings.CellValuePresenterStyle to a style with a template for that field to display the child data horizontally. You could try putting a ListBox in the template that uses a horizontal stack panel.
This approach worked well for the customer I was working with, although I do not have a sample implementing this myself.
If I can be of furhter assistance, please let me know.
Thanks,
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
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 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
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.
The installer would require a different key than the previous version of NetAdvantage. If you had an active subscription when NetAdvantage 2011 Volume 2 was released then you would have been given a key at that time. If you didn't have an active subscription then you would need to purchase to get the newer key. Sales will be able to assist you with obtaining new keys if needed. You can email sales using sales@infragistics.com.
Can we upgrade the new version with the same registration key or should we go for new one?
If you are looking to merge the cell that is created for the parent so that there is one cell for all of the children then your best option would be to upgrade to 11.2 and use the XamGrid as the XamDataGrid doesn't have the same cell merging functionality.
In the solution you provided, for every child the parent will be repeated.I need to display parent cell displayed only once for all children, if possible through merged cells.ideally, the parent should not be displayed for each child.Is there a way to achieve this? I know there is an option in XAMGrid through merged cell grouping.but I am not using 11.2.Is there any other way to do this in xamdatagrid itself?
mankandev,
Please provide more details on what you are looking for. From your description of "I need to group it in 2 levels in a row" I am not sure if it matches what I have provided above or how to best answer your question.