Hi,
is it possible (and if yes, how?) to create an xamdatagrid that looks like this? Or should i use something else instead of xamdatagrid?
I also would like the parent records to be collapsible. And AutoGenerateFields should be false.
Parent class has some string property, and a Child List. And the Child class also has some string property.
Thank you :)
thank you, it's working. :)
Hello,
You would have to try and have ParentRecord inherit ChildRecord perhaps since Age isn't there.eg.public class ParentRecord : ChildRecord
Thank you, I also tried to do it using this link, but it's not clear for me. :/
I have these classes:
public class ParentRecord{ public ObservableCollection<ChildRecord> Children; public string ID; public string Name;}
public class ChildRecord{ public string Name; public string Age;}
And I would like 3 columns: id, name, age. Like this:
Please attach a sample project demonstrating the behavior. Are you binding to homogeneous data or heterogeneous data? aka single or multiple data types?
This topic explains both
https://es.infragistics.com/help/wpf/xamtreegrid-binding-to-data#_Ref411351578
If you are binding to a datasource with a multiple data types and Age isn't a property the parent data object then it will cause issues.
Hi, thank you for your help.
It's almost working, I have just a little problem. I can't see the age column after the name. If I put it into the first FieldLayout, then even the xamTreeGird is not visible.
<igDP:XamTreeGrid DataSource="{Binding ParentRecordCollection}"> <igDP:XamTreeGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False"/> </igDP:XamTreeGrid.FieldLayoutSettings> <igDP:XamTreeGrid.FieldLayouts> <igDP:FieldLayout Key="ParentRecord" IsDefault="True"> <igDP:Field Name="ID" Label="id"/> <igDP:Field Name="Name" Label="name"/> <igDP:Field Name="Children"/> </igDP:FieldLayout> <igDP:FieldLayout Key="ChildRecord"> <igDP:Field Name="Name" Label="name"/> <igDP:Field Name="Age" Label="age"/> </igDP:FieldLayout> </igDP:XamTreeGrid.FieldLayouts> </igDP:XamTreeGrid>