Hi,
I'm using the XamDatagrid to display hierarchical data with manually defined field layout (i.e. AutoGenerate=false).
My object looks something like this:
class obj {
string Name;
List Properties;
List Objects;
}
And here's the field layout:
<igDP:FieldLayout Key="MyObj"> <igDP:FieldLayout.Fields> <igDP:Field Name="Name"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" /> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Objects" /> <igDP:Field Name="Properties" /> </igDP:FieldLayout.Fields> </igDP:FieldLayout>
The problem is, the data isn't quite displayed how I'd like to be it. Because I have 2 lists ("Objects" and "Properties"), instead of expanding to a single "merged" view of both lists, I get something like this:
Thing is, I don't want to see "Objects" and "Properties" nodes on the tree. Note that if I only had one list, e.g. I remove "Properties" from the field layout, then it won't display a "Properties" node and instead each property object will display as a direct child of setting1.
I guess I could solve this by modifying my View Model, but I'm wondering if there's an easier way.
Thanks!
Hello Danny,
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 the user expand the parent record the child collections are expanded, too and there are no collection headers and expansion indicators. I also defined the FieldLayouts and if you uncomment the FieldlayoutSettings for them you can hide the child labels. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Wow, thanks!
That did it.
Another (somewhat) related question - what if I want to display a "Name" and "Value" column headers, but only at the very top level?
The idea is that some objects in the hierarchy may have a Name and Value column and some only have "Name".
Thank you for your feedback. I am glad that I was able to help you resolve your issue. As for the child headers, you can notice in the sample that I sent you, that there is commented code in the xaml file. If you uncomment the FieldLayoutSettings for the third layout, its headers will get hidden and the grid will look as you want. Please let me know if this helps you or you have further questions on this matter. Looking forward for your reply.
Can I have the child headers appear at the top?
I have modified the sample I sent you before, so now only the first child collection has headers. Please let me know if this helps you or you have further questions on this matter. Looking forward for your reply.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Thanks for following up. I haven't quite achieved what I'm trying to do - what I'd like is for the grid to behave as if the Name properties are all part of a single column, and the "Value" is a second column. That way the grid looks like it has just 2 columns, and they're all aligned. Otherwise what I get is this strange behavior where there are different splitters and the values are not aligned. See attached screenshot.
http://i.imgur.com/xFtJCOR.jpg
What I want:
http://i.imgur.com/7c1OC31.jpg
Thanks again for your help!!
I can suggest you see this forum thread:
http://www.infragistics.com/community/forums/t/39097.aspx
where a similar question is already discussed. Please let me know if you have further questions on this matter.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.