I have hierarchical data. There is a one to one relationship between my parent and child. My requirements dictate that only the child be displayed in the grid. What is the best way to accomplish this with xamDataGrid?
My first approach was to create a new DataRecordPresenter style that has a new Template and set that on the grid. However I get a null exception during runtime and the only information from that exception is a stacktrace that goes deep into Infragistics code. Also, I am not sure what to put in the Template.
If the child is exposed as a property off the parent then the easiest way is to use UnboundFields (one for each property of the child that you want to see), setting the UnboundField's BindingPath property to "(xxx).yyy" where xxx is the name of the property exposed off the parent record which returns the child record and yyy is the name of a property on the child.
I hope this helps.
I tried the solution you proposed and it works for the regular fields, but when I use it for a ICollection field in order to make a sub-level group appear, it does'nt seem to work.
In this example, the AssetMixClassRaw.Positions is a Collection. When I tried it, I had a column named Positions instead of a sub-level group. What did I do wrong?
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings SelectionTypeRecord="Extended"
SelectionTypeCell="Extended"
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldSettings ExpandableFieldRecordExpansionMode="ShowExpansionIndicator"
<igDP:FieldLayout>
<igDP:UnboundField Label="MaturityValue" BindingPath="AssetMixClassRaw.MaturityValue"/> <igDP:UnboundField BindingPath="AssetMixClassRaw.Positions"/>
<igDP:FieldLayout.Settings>
</igDP:FieldLayout.Settings>
<igDP:Field Label="{x:Static p:Resources.AccountNumberCaption}" Name="AccountNumber" />
</igDP:XamDataGrid.FieldLayouts>
That worked, thanks!