Hello,
I have an object which contains several properties, one of which in turn has a property which is a collection.
XamDataGrid produces a single row for each instance of that object. How can i split that row into master detail, where master row would contain atomic properties, but detail row would contain the property with a collection?
Basically, this is a hierarchical model, so the grid would create it automatically - "atomic" properties on the master row, and the collection property in a ExpandableFieldRecord (+ indicator next to the master record).
This is how it would be displayed. If that does not satisfy your requirements, you can bind to the ActiveRecord property of the grid and display the nested data elsewhere. Please give us more information about how exactly you want to display the data and we will be glad to help.
Regards,
Alex.
Thank you for the answer.
The property which has to be displayed in the detail row is not a collection itself. It is an object with a property that is a collection. Therefore the grid just shows that object in a separate column which contains the object's type name.
What i'd like to do is to transform that column into a row that would contain data from that object's collection.
Unfortunately that wouldn't work, as i don't know how to split the object into two rows and i don't want to have a field for each collection item, but a child row instead.
Any more suggestions?
In this case, your option is to use UnboundFields and set BindingPath. For example:
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="FirstName" />
<igDP:Field Name="LastName" />
<igDP:UnboundField BindingPath="Property.SubField1" />
<igDP:UnboundField BindingPath="Property.SubField2" />
<igDP:UnboundField BindingPath="Property.Dummies[0].SubField3" />
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
Hope this helps,