I am using a XamDataGrid to attempt to display records from nested List<objects> I have a Top level class of type List<> which has two sub lists of type List<>.
Three issues.
1. When displayed the nested lists are stacked instead of display as a parent/child drill down style. They have a common key field and the grid layouts are not picking up on them.
2. I have had always found this to be sort of a bug, but it's probably me. When ever I define a layout and set AutoGenerateFields="False", my layout is never displayed? That same issue is occuring on this grid. The nested data is not being associated with the layout.
3. When I try to assign the layout to the data, it tells me the data object does not contain the key field. I suspect the grid reflection cannot find it because it's nested?
I have included an image, the xaml and the code behind.
Ideas appreciated.
Glenn
Another thing that might be causing the problem is missing declaration of fields.
Please, make sure that the Fields are declared correctly, like this for example:
private int id; public int Id { get { return id; } set { id = value; } }
Alex.
Hello Glenn,
As the forum supports only one file to upload, you can use WinZip to zip many files and attach then as an archive. I am not sure whether I can reproduce the scenario using your code as some pieces are missing. Is it possible to make a small sample project that illustrates the problem?
First thing that comes in my mind is that you can try replacing the List<T> with BindingList<T> as the BindingList supports two way binding.
And here is a copy of the xaml.
For whatever reason this forum only allows one attachment. Here is a picture of the stacked grid.