I'm able to create a hierarchal grid using AutoGenerate="True", but I need control over the fields to manage which ones are to be hidden, and to allow users to update values within the grid.
How can I create a hierarchal grid which can have any number of child nodes (infinitely deep), while AutoGenerate="False"?
This was helpful. I needed to add the "Children" field in my default layout, as you have in your demo
Thanks!
Hello Patrick,
Thank you for your update on this matter.
Since the children are the same structure as the parents and you are looking for a similar structure on each hierarchical band, you actually only need a single FieldLayout in this case when manually generating your Fields in the XamDataGrid. FieldLayouts are handled on a type-by-type basis, and since you essentially only have a single type, your FieldLayout will be reused across all bands regardless of how deep the maximum level of your hierarchy is.
I am attaching a sample project to demonstrate the above. Please let me know if you have any other questions or concerns on this matter.
XDGInfiniteHierarchyDemo.zip
Hi Andrew, thanks for the quick response
1. Yes, the children are the same structure as parent(s)
2. Currently no, each record could have any number of levels deep. But if that is a show-stopper, I could find a way to "predict" the lowest level, but we would like to avoid this scenario if possible
3. Yes, since the parent has the same structure as the child, we would expect to edit any field at any level
Thank you
I have been investigating into the behavior you are looking to achieve, and I have a few questions for you on this matter, mainly relating to your data structure. These will determine my recommendations on this matter, and as such, can you please provide some information on the following?
1. Is your data item homogeneous? That is, do the collections representing the child collections have the same type of item in them as their containing class?
2. Will you know how “deep” the child hierarchy is at design time such that you can design the multiple FieldLayouts in XAML, or is this an unknown?
3. When you mentioned you would like to manage which Fields are hidden or which Fields would be editable, would this apply across all hierarchical bands? That is, if you were to have the same Field in multiple bands, would hiding one or enabling edit mode on one apply across all hierarchical bands?
Please let me know if you have any other questions or concerns on this matter.