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
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.
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.
singlemalt, I have logged Feature Request FR13085 with Product Mangement on your behalf.
Thanks. So just to clarify. If you had a Customer object with multiple Phone properties which are also objects with properties. You could have the grid display.
Customer.Name, Customer.Phone[0].AreaCode, Customer.Phone[0].Subscriber, Customer.Phone[1].AreaCode, Customer.Phone[1].Subscriber.
I have accomplished it by just copy/pasting the phone field defs, multiple times. Works. But yes, this feature would be great to not have redundant field defs.
Another approach I thought I could try was to somehow declare another grid that is just the Phone record and then merge that into the parent grid multiple times. I did not see how to accomplish that. It would be really slick to be able to do it as datatemplates or contentcontrols (defined as resources).
e.g. symbolically
<xamDatagrid>
<local:customer/>
<local:phone/>
</xamDatagrid>
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.
Let me know if you have any questions with this matter.
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.