Hi I am struggling to create a heirarchical xamdatagrid in the code behind. I am trying to create two fieldlayouts where one is used for a childlayout. Any advice on adding a child fieldlayout in code I have been unable to find any examples on this. Something similar to the c# here DefiningFieldLayout but for a heirarchical structure would be ideal. Setting the parentfieldname and parentfieldlayoutkey in code has not been working.
Thanks
Hello Calum,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Amazing Stefan I knew I was close
I have been looking into the sample and I modified it, so now it works as you want. Basically instead of using UnboundField for the child collection, I used regular Field with properly set Name. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks for the quick reply. This is not quite what I was looking for. I am trying to create the child rows through a binding by adding an expandable unbound field to the layout. Obviously this is not how to do it. I have attached a sample program which demonstrates hopefully what I was trying to get across.
Hello Claum,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically when you have hierarchical data, the parent field layout should contain a Field with a Name equals to the child collection name or, when you have DataSet, to the relation name. Please let me know if this helps you or you have further questions on this matter.