I have defined the columns of my XamDataGrid using FieldSettings and FieldLayout. But the problem is, that the grid takes all the properties from the "inserted" objects and displays them as columns. This means, that I have to create a specific ViewModel-class for the DataGrid, which is a bit annoying.
The standard WPF DataGrid has an attribute called AutoGenerateColumns. Does the XamDataGrid have something like this? I can't find it...
Hello again,
I apologize for the misunderstanding. I created a sample project for you with the functionality you want. My custom class has two collections, too and I define the FiledLayout, so that only one of them is shown. When you have hierarchical data you should define a Field with the name of the collection or if you have DataSet, with the relationship, when the AutoGenereateFields property is set to False.
Looking forward for your reply.
Isn't that the same as my previous question?
What I want to do here, is to specify the collection from which the nested items should be taken.
For example I have a vmProject ViewModel-class, that I use in my XamDataGrid. This class has two public collections, "Versions" and "Notes". In the XamDataGrid I only want to display objects from "Versions" as child-elements of vmProject. As of now the Grid displays both collections!
I still want the AutoGenerateFields set to false so that I can specify the columns myself.
You can set the AutoGenerateFields property of the nested FieldLayout to False and define the Fields that you want to be displayed.
Hello again
The objects I'm displaying in the XamDataGrid have multiple public collections. How can I specify which collection should be used for "nested" items in a hierarchical XamDataGrid?
Thanks that worked great!